Questions tagged [winforms]

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

Filter by
Sorted by
Tagged with
0 votes
3 answers
98 views

How can I keep accurate time in a Windows Forms (WinForms) application?

I am an inexperienced developer fresh out of college. I was handed a Windows Forms Application to work on. The application previously relied on system time. They wanted me to make it so that we could ...
mpAppProg's user avatar
2 votes
1 answer
136 views

How to properly use Data Transfer Objects

I feel something is wrong with my approach handling MVP and the Repository Pattern. I'm making an album winform app just to practice MVP, crud and the Repos. Pattern. First some code. The model: using ...
Valmont's user avatar
  • 173
2 votes
0 answers
69 views

Best approach for several steps with user input in between

I've read several questions and I couldn't find one specifically similar to mine. I also don't think there's a design pattern for this situation as I think my system is a legacy system and don't fit ...
Rick Wolff's user avatar
-1 votes
1 answer
329 views

Hardware test GUI with multiple event sources (4 serial ports and user interaction) - best architecture?

I have the following requirements: Write a GUI app for automated testing of some custom PCB hardware. The system must be usable for a technician with little to no advanced PC skills. The test setup ...
Louis Cloete's user avatar
0 votes
1 answer
101 views

Recommended way to use a python backend from a c#-application

I have an old windows forms gui used to control a custom measurement system. Originally, it handled acquisition, calculating, database handling and presentation of measurements. Now, because of some ...
Darki's user avatar
  • 3
-3 votes
1 answer
362 views

What data structure works best with File Explorer-type applications?

I'm working on a desktop application in C# that reads a directory and displays in a DataGridView the directory entries of the PDFs found in that directory, like a File Explorer that only shows PDFs. ...
RobertSF's user avatar
  • 105
4 votes
1 answer
2k views

How to separate "unmanaged" and "managed" code in my C++/CLI project

I am developing a project using C++/CLI and WinForms. It is a geometry project, which is why I have to use C++/CLI, because of the C++ geometry library CGAL. I chose to use WinForms for the UI because ...
Simon H's user avatar
  • 151
1 vote
1 answer
353 views

Adding item (or incrementing count) to ListView, with the MVP pattern in WinForms

Description A WinForms application with the following as part of a form: When the "Add" button is clicked, a new entry is added to the ListView, with data from the TextBoxes and ...
Al2110's user avatar
  • 245
2 votes
3 answers
460 views

Changing control name property during runtime -- Why doesn't anything break and why shouldn't I do it?

To make a long story short, I needed a property of a button to act as a "secondary text property" and retain the original .Text value of a button, and the only String property that wasn't ...
Hawkeye's user avatar
  • 147
0 votes
0 answers
412 views

Structuring a "Large" Windows Forms Project and Solution To something with Multiple Sub-Projects

I've willingly inherited a VB.Net forms project based on .Net 3.5 last edited with VS2012. I was able to open it up and up-convert it to VS2017. I can compile and run it and make some little tweaks. ...
GisMofx's user avatar
  • 379
5 votes
3 answers
1k views

Single massive solution - good idea?

I am analysing a Windows Forms application in .NET Framework 4.5.2 with 4 separate solutions with a combined 1.5million lines of code (and 10 years of development) Libraries.sln (54 projects) Tools....
Dave Mateer's user avatar
-3 votes
1 answer
2k views

Choosing architecture for Winforms C# application

I'm developing GUI for controlling and testing hardware device. The GUI consists of many basic controls like textboxes and radio buttons which are mostly independent of each other - each control ...
Jack's user avatar
  • 105
7 votes
2 answers
643 views

Daylight savings time for real time application

I am building an application on windows forms C# that will run in real time 24 hours a day 365 days a year. This application tracks the time that components are out of storage. I am running into a ...
Stephen Carey's user avatar
0 votes
3 answers
2k views

How to handle views and logic in a Winform C# app? [closed]

I come from a webdev background so I'm used to MVC to handle the separation between the views and the logic (and the data/models). I'm starting to develop using Winforms in C# and I want to know what'...
nick's user avatar
  • 101
2 votes
2 answers
185 views

Solving similar devices problem

Problem: Winform app for servicing different types of devices (approx. 10 types). Some devices have more settings similar (or same) then the others. Each device could also has software and hardware ...
Artholl's user avatar
  • 155
0 votes
2 answers
604 views

Winforms: Using the designer vs. generation by code

Due to a new job opportunity I am switching back from WPF to WinForms. Currently I am playing around a little to get used to it. Here are my main questions that arose: Should I use the designer in ...
selmaohneh's user avatar
0 votes
1 answer
689 views

About Three Layer Architecture

I'm currently developing a minor project for school and I'm supposed to use a three layer architecture in the project. I'm working with C# in .NET and I'm also working on Windows Forms, and with the ...
schmakydoodle's user avatar
-2 votes
1 answer
546 views

How should i license my application?

I developed c# winform application which monitors database and I want to license it. License will be concurrent based. Standart license 2 concurrent users, Premium users 5 concurrent users. I want ...
S. Doe's user avatar
  • 9
2 votes
3 answers
891 views

Are there any benefits of using .NET Framework 4.0 Client Profile nowadays?

We are developing visual controls for WinForms in .NET, and one of our customers using our products is still compiling all his apps for .NET 4 Client Profile. He has to do this as his customers, some ...
TecMan's user avatar
  • 137
1 vote
1 answer
383 views

how should the MVP pattern handle views created at runtime?

how should the MVP pattern handle views created at runtime ? for example There is a mainView (that has a model and presenter) that needs to display a list, each item in the list is represented by it'...
user1450877's user avatar
  • 1,052
3 votes
1 answer
3k views

In a C# Windows Forms application - how does the message pump use the main/form controls thread to update the form?

From my understanding, the form and all of its graphical controls run on the main thread. The form is displayed by the main thread and the inputs from the keyboard and mouse are received via the ...
WZRh1jq91's user avatar
13 votes
1 answer
17k views

How can I apply the MVC pattern to a C# WinForms application?

I'm a C++ developer who has been using the MVC pattern to design GUIs ever since. Recently I wanted to get back into C#, and I set up a Windows Forms application, but now I am a little bit lost on ...
Sossenbinder's user avatar
0 votes
0 answers
79 views

Creating a common ancestor form in Visual Studio

I have 5 forms which in hindsight should have an ancestor descended from Form. Unfortunately, the common elements of the forms is a splitContainer and a listbox in one of the containers. Each form ...
Loren Pechtel's user avatar
1 vote
0 answers
264 views

How should I implement generic datagrid for CRUD Operations?

I wrote multiple times different apps that have following requirement. CRUD Operations via DataGrid control... Everytime I start new prject I write new code for same requirement over and over - what ...
ChenChi's user avatar
  • 119
4 votes
2 answers
839 views

A simple GUI app: states

I'm making a Windows Forms app: It is client-server. Authorization, then load some data from server, then send back some statistics from time to time. You should go through a bootstrapping procedure, ...
Andrey Moiseev's user avatar
3 votes
0 answers
71 views

Entity Framework - Old school save/update advice?

I've a query for you relating to best use of EF6 when using Winforms yet not having justification for changing things to something more modern. I've got half a dozen classes that are based on ...
Richard's user avatar
  • 211
1 vote
1 answer
1k views

I have a few questions about the MVP pattern in a WinForms project

I hope someone can answer these. I have a WinForms project with +/- 8 forms. I have an SQLite database and a class that handles the queries to this database. I would like to use the passive View ...
Marthe Veldhuis's user avatar
3 votes
0 answers
78 views

Background operations in controller/presenter or form?

I have a desktop application with each window decopuled into presentation layer (containing the Form/Controls etc.) and application layer (Controller/Presenter - naming is irrelevant to the question). ...
Mariusz Jamro's user avatar
3 votes
0 answers
1k views

Traditional installer for a WinForms application

What is the preferred method of creating a "normal" traditional installer for a .NET WinForms application? I'm using VS 2015 which comes without a template for such a deployment project. I installed ...
Yuri Makassiouk's user avatar
3 votes
2 answers
327 views

GUI applicaton states and polymorphism

I have WinForms GUI application, which can work in two "states" with different functionality, but these states share GUI controls. I am dividing these states by using enum almost in every method, like:...
Majak's user avatar
  • 199
0 votes
1 answer
651 views

How could I approach building a Tile based Map Editor in Winforms?

I need to build a Tile-based Map Editor in #C Winforms. My main concern is drawing the tiles. In what space should I draw the tiles? Within a Panel? A Picture Box? Also, I obviously need to draw ...
Sebastian King's user avatar
1 vote
0 answers
63 views

How to display a very delayed success message after async method call in WinForms after Form is closed

The users are on a Windows Form where they fill out a fax cover sheet and hit Send. The remote fax service takes anywhere from two seconds to two minutes to return a result (long timeout). By that ...
TR888's user avatar
  • 209
1 vote
1 answer
1k views

General guidelines for architecturing a plugin based application

Our application is composed of a main webapp and a handful of windows services that perform a variety of jobs that feed, sanitize and optimize that webapp. In order to ease the task of maintaining ...
Henrique Miranda's user avatar
1 vote
1 answer
1k views

How to create a layout of controls that can be duplicated on a form at runtime

I have a bunch of controls including labels, updown menu, combo boxes, radio buttons, and check boxes that must be replicated once someone hits the add button. Is there a way that I can create a ...
BernWillChris's user avatar
1 vote
2 answers
339 views

Separating save logic from WinForm to make it reusable

I have a Windows Form for creating configs. It has around 50 fields of data, which represent a group of entities, that I need to capture when the user presses the save button. Currently, on the press ...
rævvah's user avatar
  • 55
0 votes
0 answers
51 views

Is it good practice to code entire business form as single component (control)?

Is it good practice to code entire business form as single component (control) and then proudly put it on window/form as the final step in development? Of course, this form can involve some other ...
TomR's user avatar
  • 1,003
0 votes
2 answers
3k views

Why use using-statements when you want to reopen connections? [closed]

In a Winforms project I've been working on recently, I've been dutifully using using-statements for objects that implement IDisposable. I want to reopen a database connection, however because the ...
user3750325's user avatar
1 vote
3 answers
1k views

Use case for async/await?

Background Most of the applications that I write are hour long sequential tests for electronic equipment. The equipment under test has a specification that is a state-machine that looks like... Get ...
Snoop's user avatar
  • 2,718
-1 votes
1 answer
771 views

Winform User Control on ASP?

I wrote a C# Winform User Control as follows when Executable is Run: My question is how we can use this Winform C# user control in one ASP Page. I know about WEB User Control and using in ASP but ...
Mio Unio's user avatar
1 vote
0 answers
363 views

Using events and event subscribers to create windows in a desktop application

I should probably open this by saying I do mostly Web applications at work, which obviously have some major differences from typical desktop stuff. I had a small Windows Forms program I'd made for ...
Casey's user avatar
  • 263
1 vote
1 answer
2k views

Why are interfaces necessary in MVP design pattern?

I am trying to understands MVP using Winforms. I found this example. Why do UserModel and UserView need to implement the IUserModel and IUserView interfaces ?
Orvel's user avatar
  • 159
5 votes
4 answers
726 views

Object with Customized Properties and Methods

A project I am working on currently models Order information. Right now, there is one class with a bunch of properties and functions that all of orders have in common. In addition, some of our users ...
KevenDenen's user avatar
0 votes
1 answer
1k views

C# Application GUI design dependent on configuration

I have built quite big WinForms application working in industry for a few years. It communicates with many HW devices. Application can be configured to use or not use some of these devices and GUI is ...
Majak's user avatar
  • 199
5 votes
1 answer
2k views

Pattern for communicating between nested usercontrols and parent form (C# / Winforms)

I'm trying to decide the best way to handle communication between a UserControl that is nested within another UserControl and the parent Form itself. I have a Form, inside the form there's a ...
Adam Plocher's user avatar
0 votes
0 answers
707 views

Is it possible to have multiple threads using Background Workers for different controls within one GUI

In my current project i have a CPU intensive 3D chart that needs to be updated in real time. I have been using background workers for the project and using those, i do all the processing in the ...
r wank's user avatar
  • 103
1 vote
1 answer
1k views

Multi-threaded winforms with multiple child forms using sockets

I develop application with two main option grouped by groupBox in main form. First option is run server with specific behaviour for example I choose TCP protocol, type IP address, port number and ...
ElConrado's user avatar
  • 121
2 votes
1 answer
1k views

Two way communication between Form and plugins

I have started to develop a support tool for an old legacy system that is no longer maintained but still needed for the foreseeable future. The legacy system offers few, clunky and error prone methods ...
David's user avatar
  • 275
1 vote
1 answer
161 views

Databinding When View Differs From Model

I have an entity Customer. Customer has a collection of Accounts. I have corresponding classes. The Customer class has-a List<Accounts>. I have two views. First page shows the Customer's name, ...
inquisitive's user avatar
20 votes
2 answers
28k views

How do you separate view from logic in a Winform application?

I know there are patterns like MVC to separate view from logic, however, I don't know how common they are in Winform applications. For a C# Winform application, I may start with a Form and gradually ...
Ahmad's user avatar
  • 1,806
0 votes
1 answer
666 views

proper exception handling (throwing/message) dll libary

I just wrote a dll library using vb.net. while testing, i got an error which i did not initially use a try-catch block. The code is Try 'The first four bytes are for the Command ...
Smith's user avatar
  • 643