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.

learn more… | top users | synonyms

3
votes
1answer
60 views

Winforms Graphical Timer Control

This is a Graphical Timer control I made for C# Winforms, which taught me quite a bit (it is my first Custom Control). The code below is a fully working application with the Graphical Timer, some ...
1
vote
2answers
40 views

Updating XML config files

I have been unable to find any other way to update a user config file than the following method. ...
2
votes
2answers
75 views

Error Handling When Using Dictionary

I have set up a Dictionary that calls on a class to fill a DataGridView via SQL statements. The problem is in two (out of 5) ...
3
votes
1answer
55 views

Populating DataGrids

I'm building an in house query tool. The main form has a drop down which allows the user to select how they want to find scripts, and a drop down for what server they want to run the query on. There ...
7
votes
3answers
109 views

Dataset with optional addition to where statement

I am trying to generate a dataset from a query that has a where statement. If the user passes a value additional things need to be added to the ...
2
votes
2answers
51 views

Two Datasets Same Query

I have a form that allows the user to select a server. This will execute the exact same query just on a different server. ...
2
votes
1answer
38 views

Binding data to a ComboBox and then showing ValueMember in another TextBox

I have a comboBox and a TextBox in the View and when the view is loaded, the ...
3
votes
0answers
43 views

Binding a DataGridView to a List

I'm new to Databinding in MVP and I want to bind my DataGridView to a object list. This grid may be populated in two ways. There are TextBoxes in the form and users can enter text, and when they ...
2
votes
4answers
332 views

Silent Try_catch in high load socket server or not?

I'm working on a socket application that will listen to incoming messages from about 400 devices. They all send a message at least once per minute. Now I have a working program and it has been running ...
4
votes
1answer
55 views

PowerShell Active Directory Browser

I've just published ADExploder. It's a single-script PowerShell app (source) that uses classic Windows Forms and the Directory Services API to be able to browse nodes and properties of Active ...
3
votes
3answers
69 views

Validating a string under few conditions

Following code validates NIC number of a person (National Identity Card, no like SSN) Requirements are... Length should be 10 digits or characters All should be digits except the last one Last one ...
2
votes
1answer
44 views

Using a single validation handler for all controllers in a form

In input validation I'm using this validation method in my all Forms. Here I have a single handler for all TextBoxes in my Form and if I have other controllers like ...
3
votes
4answers
159 views

Input validation for text boxes in a Form

In a Win Form I'm doing initial validation in the Form. So before saving data, I want to validate whether all the required fields are filled (Text Boxes) by the user. There are about 18 such Text ...
2
votes
1answer
67 views

Calling a copy constructor in Presenter to prepare a list of Models

I'm new to MVP. In a presenter I have following code. Here what am I trying is to create a list of Model objects (in this case ...
1
vote
2answers
60 views

Controlling permissions in a MVP application

In a Windows forms payroll application employing MVP pattern (for a small scale client) I'm planing user permission handling as follows (permission based) as ...
1
vote
0answers
99 views

Keeping WebBrowser control's DocumentCompleted event handlers

This morning, being in urgent need of an effective subject code solution, I have had to write a "quick & dirty" custom one: ...
9
votes
3answers
321 views

Pizza form project

I've just recently started C# and I was wondering if there's anything I can improve on. My project is a pizza form, where people can order pizza and the price gets updated, depending on whether they ...
6
votes
2answers
346 views

Message estimator

I'm new to C# and OOP and am struggling to move away from the procedural way of doing things. I understand the tutorials I have looked at but find it more difficult when actually doing something a ...
1
vote
1answer
68 views

Using Models and Entities in MVP pattern

I'm a beginner in MVP design pattern and In a MVP triad, I have Model - AdvanceInfo View - AdvanceForm Presenter - ...
3
votes
2answers
58 views

Using built-in type Decimal or Entity type Advance, to hold AdvanceAmount

In a wage processing system which employees MVP pattern We have Model classes WageInfo, EarningInfo, ...
2
votes
3answers
136 views

Employee wage/salary calculation MVP solution

In this project (C# Win forms) I'm supposed to calculate wages of employees. These are the steps: Calculate earnings from Attendance data. Here all regular earnings like ...
5
votes
1answer
147 views

Calculating Earnings from attendance details

In a C# win forms payroll application I need to calculate employee salary based on their attendance. I've written a stored procedure which calculates earnings of all employees from the data available ...
3
votes
1answer
163 views

Populating a Data Grid View in MVP

I'm developing a win forms application in MVP pattern. In the application, there is a small module to show the branch offices (called points) where the attendance entering process has been completed. ...
5
votes
2answers
104 views

Keep asking the user [after performing an action] until they wish to stop

I have a form that requires the user to select photos to be included in their portfolio before they can proceed to use the app for the first time. I don't want to spend the rest of my life ...
1
vote
2answers
104 views

MVP Pattern used in a payroll solution

I'm using MVP pattern for a payroll system as my final year project. There are about 16 entity classes (like employee, client, ...
11
votes
2answers
491 views

Displaying data from a database onto a form

I'm a beginner to .NET and could you guide me to right direction. My problem is based on the following code. Here I have 4 variations of same method and all 4 variations are working fine. What is ...
2
votes
2answers
173 views

WinForm plugin architecture

I have been developing this plugin architecture, mostly for fun and education, its a simple WinForm with some plugin logic and two plugins, i want to know if there is a better way of doing it. ...
4
votes
2answers
207 views

Can calculation of word wrapping be made notably faster?

I need to re-wrap a text so that it fits a given width, font and DC. The result needs to be an array of lines. I use the following code: ...
10
votes
1answer
174 views

Password Manager UI: Populating DataGridView is Painfully Slow

I'm designing a small account/password manager using C# and SQL Server CE. LINQ to SQL is my ORM of choice. Here's the data model representing how the SQL Server CE database is set up: And here's ...
7
votes
1answer
205 views

Small C# Pong game

I recently made a 140-lined Pong game in C# using forms. Since I'm very new to programming, I'd like if somebody would please read it and give me advice on where to improve, what you believe I did ...
3
votes
4answers
108 views

Handle multiple menu click events in one Sub

I have multiple menus that will change languages in one Sub that will handle multiple events of the menus click, It is working for me right now, I'm just wondering if there is better way to do it... ...
5
votes
1answer
285 views

Fastest image upload into SQL database

Hello I am trying to upload an image (screenshot from desktop) to SQL database as fast as possible. I would like to optimize my current procedure in terms of speed: ...
4
votes
2answers
384 views

Chaining Tasks with async/await

I've been trying to learn how to use the TPL for quite some time now. Basically I'm trying to fire off a group of Tasks, wait for them to complete and then fire off another group of tasks, waiting for ...
1
vote
1answer
314 views

Winforms Enhanced ListView Class

Here is an "enhanced" Listview class. You can just add it your project and you're good to go. Most of the code came from here and there. It's not perfect by any means, so any input is appreciated. ...
3
votes
1answer
157 views

Naive implementation of attached properties for WinForms

I need to implement something like "attached properties" from WPF that targets WinForms. What I came up with seems to work. Can you find any issues with it? The helper class and example are shown ...
13
votes
4answers
680 views

Is decoupling necessary for very small applications?

I threw together a small solution for my organization today for some basic data review and approval procedures. This particular application will likely not change or add functionality at any time. ...
10
votes
2answers
806 views

BackgroundWorker vs TPL ProgressBar Exercise

I wanted to fiddle around with the BackgroundWorker and Task classes, to see how I would implement a given task with these two ...
5
votes
3answers
4k views

Loading a combobox with an enum and binding to it

I have the following code to load an enumeration into a bound combo box, but am not quite happy with it. I would prefer to store the actual enum value in the ...
15
votes
8answers
2k views

Making these conditions shorter

The problem I'm dealing with is the length of my code. I have lots of code like this: ...
14
votes
2answers
466 views

Simple temperature converter

Below is my first attempt at programming a Celsius to Fahrenheit converter in C# winforms. I'm looking for tips and advice on improving my style and what I can do to make the code more ...
2
votes
1answer
151 views

Reading a certain pixels color from a window

I'm currently reading a certain pixels color from a process window like this: ...
1
vote
1answer
214 views

Executing method on a certain interval + offset

I would like to execute a certain method at a given interval. The reason why I can't use a timer + its event handler right away is because I want to add an offset to each tick (100ms in my example ...
2
votes
3answers
1k views

Winform that exports a datagrid to Excel

I've just created a winform that exports a datagrid to Excel. Originally the file was never shown, but I was asked to give the option. So I put in a checkbox and modified the code. Is my if/else ...
2
votes
0answers
395 views

C# WinForms - Custom Application.Run Bootstrap Routine [closed]

I've got to maintain a legacy application (actually a number of applications) and currently most of the startup-settings (like upgrading App.config when the version has changed, check Database against ...
1
vote
1answer
127 views
4
votes
3answers
405 views
0
votes
1answer
73 views

Searching for a better implementation to EnumBase

In a former question on SO I described a problem with a construct called 'EnumBase'. As I sad there, I am not involved when basic implementation happened. So I'm not sure why the thinks are a they ...
1
vote
4answers
236 views

Foreach statement for two OfType<>

How would I write a foreach statement that includes both of these statement together ...
0
votes
2answers
2k views

Multiple forms for accessing records in database

I have a main form for adding and deleting records and a button that opens a child form that displays records from an access database. Child form will have buttons for moving though the rows like ...
0
votes
1answer
300 views

Is it necessary to move OpenFileDialog code for opening the files and put it into a separate method?

I want to separate the code inside my Add button click event from the code in order to make my code looks more arranged. this is my code before these changes (i am ...