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.

Filter by
Sorted by
Tagged with
2 votes
1 answer
72 views

Login authentication using MVP pattern

How can I improve my login script and is there a cleaner way to get the same result? I had this project and redesigned it using MVP patten . Working with this patten is a new challenge for me. It's ...
0 votes
0 answers
31 views

Using buttons as common for child forms c#

I have mini ERP project in C# winform. So I have too many forms in the project. I have buttons and I want want to use these buttons as common for all forms. I implement codes below but i am not sure ...
  • 133
1 vote
3 answers
193 views

Saving Multiple Lists to Database - C# Forms

I am trying to store multiple lists to a database but I'm struggling on finding a better way of doing it, as the way I am doing it now, seems to be incorrect. On my form, I have 6 different legs. Each ...
0 votes
1 answer
75 views

Creating a new WinForm each time pressing a button in a main WinForm

I have WinForm C# application that every time you press on the green button: It opens a new WinForm window. This is the code after pressing the green button: ...
  • 237
0 votes
1 answer
115 views

How to optimize the code of my pdf generation from DGV code using iText5 & c#?

I have 2 DGV's one containing bills info & another containing credit notes info. When at least one item from both the DGV's are selected then it should generate a pdf (result1) taking data from ...
4 votes
1 answer
131 views

Windows standard calulator replica in WinForms C#

I tried my best to replicate, in style and functionality, the Windows standard calculator: I would like to get some feedback on the efficiency and readability of my code as well as the approach i ...
  • 93
1 vote
3 answers
179 views

Export DGV data as a table to a word file using Xceed's DocX library

my winform app contains a combo box, a button and two datagridview among other controls. Both DGV's have 3 columns. When I select an item/items from one or both of the DGV's and hit the button the app ...
4 votes
2 answers
125 views

User interface for a simple tool that generates Word documents from Excel data

This question provides the code behind the dialogs in the C# refactoring question. I'd like a review of this code as well. I'm not currently using databinding anywhere, and there is really only one ...
  • 19.5k
3 votes
3 answers
108 views

Follow Up: Refactored C# Tool to Generate MS Word Document Mailbox List From MS Excel

Background Some very good observations were made about my original code in the 2 answers to this question. In this version I have attempted to reduce cyclic complexity and class coupling even more as ...
  • 19.5k
2 votes
2 answers
125 views

Optimize the data adding process to datatable from excel file

I'm creating a simple windows form application containing a combo box, a text box, a datagridview, a button and some radio buttons. The idea is upon the form loading the combo box is to be populated ...
0 votes
2 answers
112 views

Simple stock taking program in C# Windows forms

so I've made a simple program meant to increase and decrease numbers, then save those numbers, basically a rubbish stock taking app, I want to make one I can use and well it's usable I'd say the code ...
3 votes
4 answers
127 views

Verify that 5 Textboxes have some content

I'm new to C#. I have created a form that has 5 text boxes and this function checks to see if every text box has text in the box. If not, then it displays a message box saying "Error (Add Text)...
  • 33
1 vote
0 answers
450 views

DataGridView Undo/Redo Manager in C#

While answering this code review question, I proposed a solution with List<DataTable>. I am trying to encapsulate this data structure into a "...
  • 3,596
3 votes
1 answer
626 views

Undo/Redo Functionality in DataGridView c#

I have looked at many topics related to this topic, but I could not find or understand for datagridview table. Finally I made the undo / redo implementation myself using datatable lists. This solution ...
  • 133
1 vote
1 answer
84 views

A Tiny Image Tagger Implementation in C#

I am trying to implement a tiny image tagger with customized tag options in C#. The main window is as follows. The left block is a picture box MainPictureBox and ...
  • 3,596
2 votes
1 answer
57 views

This code loops through a GlobalEmployeesList, eliminates duplicate email and phone records for the selected employee, and populates listboxes

I have a DataGridView which displays an employee list. I use the employee ID to filter my global employee list and display information about the selected employee in various listboxes. This is my ...
2 votes
2 answers
119 views

final code of my first winform application

I am learning .NET for about a month now ..and i am practicing by making a simple WinForms project ..now almost my WinForms is completed ..i need to gather your suggestion on how my progress is going ...
4 votes
0 answers
281 views

Simple target shooter game using Windows Forms

Currently, my game is a basic target shooting game. The targets rise to the top, if the target reaches the top an end screen is shown. If you shoot a target you get more score, and the speed in which ...
2 votes
0 answers
35 views

What is the correct way to alter ComboBox between two DataSources?

I am looking to alter one combobox between two DataSources depending on the button clicked. Here are the 2 lists: ...
  • 213
4 votes
1 answer
186 views

Is my structure of program readable?

Just looking for reviews to improve my coding and my structure of C#. It feels I probably have some unnecessary code that is not needed, been following some YouTube videos to accomplish some tasks. ...
  • 213
3 votes
2 answers
99 views

Getting data from database and present it on Winforms

Currently, I am working on this project where I need to achieve the following... Get column named Category from MySQL database. And whatever the output is, check ...
  • 213
8 votes
2 answers
719 views

WinForm Logon Best Practices

I have a working logon for a WinForms Project. I use the program.cs file to launch the login form. I am not so sure there isn't a better way of implementing this. ...
  • 487
2 votes
0 answers
31 views

Applying OOP to refactor my Windows Forms APP [closed]

Could you please give me some direction about how I could refactor my code? As I add functionalities to my Budget App the class is getting bigger and I'm sure I could start looking at separating ...
1 vote
1 answer
185 views

C# easier ways to filter values in data-grid by month

Goal: My goal is to filter datagrid by selected month from dropdown options. January, February, March etc... I'd like to know if ...
  • 213
2 votes
1 answer
159 views

Windows Forms Log in and Dashboard

I'd like to see and hear some reviews on my current WinForms Login and Dashboard code. It's a desktop application to be used only internally and not over the web. If you have any code suggestions - I'...
  • 213
3 votes
2 answers
621 views

C# Window Form Application Loading data into DataGrid and highlight specific values based on their values

I'd like to hear some reviews or tips where I can improve in my code - or better if you can post your own version of the code from somebody experienced where I can visually see to why you have coded ...
  • 213
3 votes
0 answers
59 views

Identify clickable area in a big panel

I have a panel that has 4 images per row and a lot of rows. Each image has a 15 pixels separation and are 250,250 each. Here is a screenshot: I'd like to be able to click on a picture and identify ...
2 votes
0 answers
31 views

Web API wrapper design and sharing EF database context

I'm trying to keep my sanity while working with a legacy winforms application that uses an web api, both maintained by my team. In the past we have multiple cases of methods using wrong api endpoints,...
4 votes
1 answer
372 views

C# MineSweeper Game using winform

I designed a game with trying to use solid principles. What changes should I do for making program more extensible, readable. Thanks in advance. Cell class ...
  • 81
3 votes
2 answers
72 views

Entering specific models, brands, and prices into system

Specifically the if/else statements trying to match model and brand. The code works, but it's ugly. Any suggestions to clean it up? ...
  • 83
1 vote
1 answer
165 views

C# MySQL connection and some queries

Goal: I am trying to get the hang of using MySQL connections within C# windows forms. These are such areas I am targeting: Loading dataGridView correctly Refresh dataGridView from an external form (...
  • 213
4 votes
1 answer
1k views

C# Windows Forms App: Adding An Element To The BindingSource And Save These Changes To The DB [closed]

I have build a C# Windows Forms app that used Entity Framework(DB first model). For the data I am using a .mdf database file. The data view of dbo.students: GUI: The Form1 class: ...
's user avatar
2 votes
2 answers
91 views

Is there a better/cleaner way to assign values based on the result of radio buttons?

I have 3 radio buttons all grouped inside a group box in a WinForms project. Currently, I am checking which button is checked and assigning values using the following if/else statement, similar to the ...
  • 145
7 votes
1 answer
657 views

Minesweeper Implementation c# winforms

I made a minesweeper game in c# as a method of studying, and right now its fully operational. I tried to use inheritance, recursion, and other fundamentals as clean as possible. Also I tried to use ...
  • 73
4 votes
1 answer
68 views

Simple winform that randomizes images in a picturebox

I wrote this code for a simple app that gives us random images. The code works, but I feel like I'm doing something wrong. And one thing I would love to know is instead of grabbing from a folder ...
1 vote
0 answers
66 views

Work-in-Progress Form to be used throughout an application

I want to write my own Work-In-Progress form to use it throughout my app (for the time being, mostly as an exercise). I came up with the following code, I would like to know what are the design ...
  • 171
6 votes
1 answer
226 views

TreeView class in WPF class

We are converting a WinForms application to WPF. so I need to accept the input like WinForms. As I don't want to change the logic of it. Ao I write the class for those its works. But the is not good ...
4 votes
2 answers
237 views

Reading Data from XML and storing them into SQL Database

I am developing a C# Windows forms application. In that, I am reading data from XML which is coming from a web API and storing that XML data into SQL database. I am able to achieve this. But my only ...
5 votes
1 answer
106 views

Page-by model of data output and search results with values for UI

This is my first experience of designing classes with inheritance. I would like to get feedback on the interaction between the presented classes. It is unlikely that this code will seem complicated. ...
  • 204
8 votes
2 answers
1k views

ROT13 encoder/decoder

This is a simple utility, intended to sit on the desktop for when needed, that does the simple ROT13 encoding and decoding. I am used to coding in VBA, and I am interested in more .Net idiomatic ...
  • 2,336
3 votes
1 answer
123 views

Small application for manipulating users and their activities

I made a small application using C#, SQL Database, entity framework , and windows forms to manipulate users (...
-1 votes
1 answer
87 views

Adding filtered data from database into a grid view [closed]

I'm trying to optimize this nested foreach and if statement function for work. My code is retrieving data from a SSMS SQL database with thousands of fields from multiple tables of data, moving them to ...
-2 votes
2 answers
53 views

Initialize global repository or in forms? [closed]

Until now we have always initialized the repositories, that containing MySql functions, at the beginning of each Form Something like that Form example code: <...
6 votes
1 answer
375 views

Spliting PDF and get thumbnail while adding it to a ListView

I'm doing a application to work with PDF and TIFF files. To divide them, the user opens the file or folder (if it is a folder, it gets all the files inside) and the app splits the file, getting a tiny ...
5 votes
0 answers
147 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 ...
  • 255
5 votes
2 answers
2k 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
1 answer
76 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 ...
3 votes
2 answers
107 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. ...
2 votes
2 answers
105 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 ...
6 votes
2 answers
260 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 ...

1
2 3 4 5
7