Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [winforms]

WinForms is the informal term given to the graphical application programming interface (API) included as a part of Microsoft's .NET Framework, providing access to the native Microsoft Windows interface elements by wrapping the existing Windows API in managed code.

4
votes
0answers
36 views

Winforms MVP Validation

I have a Winforms MVP application where I need to use the ErrorProvider on the view. I have added the following methods to my presenter to allow me to show the ErrorProvider but it just doesn't feel ...
5
votes
2answers
142 views

Minesweeper game using Winforms

I made a Minesweeper for school and it works already. The only problem I have is that I need to optimize one part of my code but I have no idea how. The code below is for the whole program. The second ...
0
votes
1answer
43 views

Business Layer Using DTOs and DataTables

I have a business logic layer class for creating and updating work orders, it also retrieves existing work order details from the database and displays it to the user on a form. The business logic ...
2
votes
2answers
79 views

CSV reader in Windows Forms

I have a csv parsing method in my Windows App that reads headers and information from the subsequent lines. I am not sure if I am doing in an efficient way. Please comment. ...
1
vote
2answers
88 views

Validation and business logic for a form for milling jobs [closed]

I have the following BLL (Business Logic Layer) class. It is the first class I have created that takes away all responsibility from the UI (where this class is instantiated/created/called) in terms of ...
4
votes
2answers
174 views

Windows Forms Clock

Extremely rough and laggy clock I purposely made the timer interval less than a second in hopes for making things run smoothly but it even worsened the situation! I thought of making the seconds hand ...
3
votes
1answer
83 views

Drawing shapes in a GDI window

I've been tasked with writing a windows form application that offers some options to modify the drawing of shapes within another window. I have very little experience with event-driven programming and ...
0
votes
0answers
45 views

Using an N-Tier architecture for a dynamic CRUD user control system

I want to design a flexible dynamic system for a client with standard data-entry screens and CRUD UserControls I dont know whether ...
4
votes
2answers
127 views

Portrait Painting Genetic Algorithm

Inspired by this article. I've been trying to learn more C# and OOP. Here is my take on a genetic algorithm as described in the article. Here are some of the results flower jelly lighthouse beach ...
5
votes
1answer
86 views

A Day at the Races. Racetrack Betting App

I recently began learning C# and I picked up Head First C# as a starting point. One of the first projects they have you build, without the code provided, is a racetrack betting app. The project first ...
18
votes
5answers
3k views

House plan design (Head First C#)

I've been working through the book Head First C# and this is an exercise from chapter 7, which is about interfaces and abstract classes. Note that the class design was mandated by the authors, I'm ...
9
votes
2answers
537 views

Calculate subtotals and totals from a form with many decimal values

I've got 17 currency fields on a form and need to do some calculations with their values. I wrote this method some time ago and have come back to try and refactor it to make it more efficient and/or ...
0
votes
2answers
52 views

A WinForm application that filters users

I built a small WinForm application that has checkboxes to filters users with different properties. Each user has a name, color and number. With the program you can filter by color or name the users ...
2
votes
2answers
93 views

Assign a value to combobox depend upon other combobox value

I have a windows form in C# project that keeps some information. I created a bunch of textbox and combobox dynamically, depend upon user input. Consider, I have a list of 10 combobox whose values ...
2
votes
4answers
209 views

Using JSON file for employee pay data

I'm looking for some feedback on my code here. I want to eliminate duplicating the code through the different button_clicks. I'm thinking with a method but nothing ...
5
votes
2answers
270 views

Tic Tac Toe with images

This is my first 'real' project in C# , i looked up some tutorials on the Internet for Tic Tac Toe. But they were not how i wanted it to be, so i came up with some own ideas and wanted some tips on ...
-2
votes
1answer
151 views

Data entry User form Application - winforms

Background: I'm designing a system Data entry form using c# as front end and sql server 2008 as backend database. In this app I'm basically, just reading/writing to the database My issue: I never ...
2
votes
2answers
98 views

A 3 digit stopwatch

I decided to make a stopwatch as I decided it would be useful, and also as a challenge to learn more about how forms work. I'd just like some simple advice as to anything I can do better, thank you. <...
0
votes
1answer
69 views

Dictionary to generate control names

I have found myself referencing controls on a form (think Windows forms but more proprietary) by hard-typing their names in over and over again. Often I'll have a number of similar controls which ...
10
votes
2answers
3k views

Clearing all controls

I'm clearing all the controls on a windows form with the following ...
3
votes
1answer
70 views

Loading icons in two different sizes

I am loading 3000 individual icons at run time one of my controls uses large icons, the other uses small icons. This works however seems terribly inefficient. The only way I can get the icons to be ...
7
votes
2answers
309 views

2 player TicTacToe

Can I optimize this Tic-tac-toe game or make it smaller? Known optimizations: string turn = "X"; can be changed to ...
1
vote
2answers
189 views

Selecting form controls that are either inside or outside a rectangle

I have a function which loops over the controls on a form and checks to see if it's in a given rect, and then adds it or doesn't add it to a list<>. The ...
6
votes
1answer
239 views

Winform, with a workaround to avoid dependencies

I'm working on a Winform project. We currently have a modular design (shown in the image) in our project. Where on every user action (button clicked or selection changed etc), first we set the Model ...
2
votes
1answer
61 views

Extendable way of providing metadata on a list

We have a winforms application with a lot of grid views. These grids have some basic layout functions (text color, font weight, font style, ....). I need to make sure that other developers can make ...
2
votes
0answers
212 views

Refreshing cell values in visible rows of a VirtualMode DataGridView

I have a DataGridView whose Virtual Mode property is set to True. When values of the underlying list are updated, those updates ...
4
votes
1answer
427 views

PauseOrCancelTokenSource

I added this implementation of PauseToken and PauseTokenSource to my project from this MSDN blog post: Cooperatively pausing async methods Since I will usually be passing in both a PauseToken and a ...
8
votes
1answer
500 views

MVP Passive-View

First of all, I'm really new to the MVP design pattern (Passive-View) and I've been trying to implement it in a WinForms application. Before I'm going any further, I'd be very happy if you guys can ...
4
votes
1answer
467 views

Copy files from three folders into a fourth one

I have a simple WinForm application that copies all files and directories from three folders into a fourth one. All folders are chosen/entered by the user. Security ...
3
votes
1answer
56 views

Find matching image and metadata files, pull data and rename both

My Original - Read date from a file and rename two files using the date github if you want to see behind the scenes. I like taking pictures of birds. Lots of pictures of birds. My camera counts ...
7
votes
2answers
3k views

Banking application for practice

A few weeks ago I have started to teach myself C# and just finished my first little project, a very basic banking application. I don't expect it to be good but would like to get feedback (no matter ...
1
vote
2answers
716 views

Creating lists of Card objects

I need to create two lists of Card objects in C#. A Card class is defined as: ...
3
votes
1answer
916 views

Function that loads a random image using an array of paths to images

I have created a program that generates a random image from a folder of all the world's flags. First, it generates an image as it loads, then it can keep randomizing the shown image if the user clicks ...
1
vote
0answers
86 views

ChatApp (Web API, Windows Forms and Azure SQL Database)

I have been working on chatApp (my first app in c#). I used Azure SQL Database, ASP.NET Web API and WinFroms. The app works very well with no errors Please give me your professional opinion and ...
1
vote
0answers
81 views

Interface prototype that draw on windows forms chart

now I'm working on some code that will control external FPGA and draw some data on WF chart. It has complete functionality now, but I'm interested in better practices of doing interfaces. I have UI ...
2
votes
1answer
76 views

Form for showing diaper prices

Here's a small program to tell our employees the price of our diapers. Is there a way such as an int array or an optimized way to set brandLevelNumber & sizeLevelNumber to the selected items in ...
1
vote
1answer
395 views

Prevent recursive calls in WinForm event handlers

Changing TextBox.Text within the TextBox.TextChanged event can trigger a recursive call to the same event handler. My class <...
5
votes
3answers
680 views

Simple Photo Gallery Image Formatting Tool

I created a little tool to help me take a folder of images and convert them into a properly formatted structure for a photo gallery I'm working on. This includes keeping the original high res photo, ...
2
votes
1answer
37 views

Loading and parsing WinForms menus using LINQ

I'm refactoring a WinForms utility program for building and testing regular expressions. The program has a menu item which lists the RegexOptions enumeration, ...
1
vote
0answers
123 views

News crawler for Google

This is one of my first "real" application using C#, so I'm probably doing a lot of things wrong. I made a simple news crawler, which uses Google to search for news articles of multiple companies. ...
3
votes
1answer
992 views

Cloning Windows Forms controls from a template

In a recent project I needed a way to clone windows forms controls from a template which had predefined Size, Font, etc. Since ...
2
votes
2answers
2k views

Is ThreadPool QueueUserWorkItem best option for handling event? [closed]

I have a WinForms application that has value change event coming from ble device. The event can be hit from more than one device also one device can send a notification to event in every 4 secs. ...
2
votes
2answers
894 views

Unit conversion application

I have a form with listboxes used for unit conversions. I'm using the UnitsNet package. Here are my questions: Is this the proper approach? If any changes must be made to this code, what are they? <...
1
vote
0answers
68 views

Merging/Chaining WebRequests

This code is used to login and check if the user has premium, and if so, add it to a ListView that then enables premium options. Is there a better way to link all of these web requests and just make ...
-5
votes
1answer
529 views

Winforms tree view checking/unchecking

How can I improve the tree searching algorithm, or can I? ...
18
votes
6answers
8k views

Login form C# SQL

Basically this is my first login form. I am using SQL and C# WinForms. I made user roles such as "Admin" and others and the user is taken to a specific WinForms, according to his appointed role (...
3
votes
3answers
1k views

A weather application

I have recently picked up c# using visual studio and set myself a project to create a weather application. I would like a peer review of my code so I find areas where I can improve and learn more best ...
6
votes
3answers
708 views

Checking whether textboxes have data

I always end up creating a quick return statement above a code block if the simple condition of textbox null fields are found. Naturally, these tend to build up the more controls are added. Now I'm ...
1
vote
1answer
739 views

Winforms tools for selection of items using ComboBox - binding datasource

This is mi UserControl containing ComboBox and few buttons for selecting and manipulating collection of items which implement simple interface IHasHeader (just ...
3
votes
2answers
110 views

Update/Insert/Delete on a particular database table

I'm updating a solution that I wrote a while ago. I've got a WinForm that does Update/Insert/Delete on a particular database table. I've got all of the database access code in the form. Is this bad ...