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
3
votes
2answers
103 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 ...
1
vote
3answers
79 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 ...
3
votes
3answers
99 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 ...
2
votes
2answers
111 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 ...
3
votes
4answers
123 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)...
0
votes
2answers
98 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 ...
19
votes
6answers
10k 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 (...
1
vote
0answers
223 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
votes
1answer
422 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 ...
1
vote
1answer
80 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 ...
12
votes
2answers
8k views

2D Collision Detection

I wrote this a while ago but wanted to see if I went about it the right way and if my brain is working correctly. I was thinking about these two projects the other day and I recently released the ...
2
votes
1answer
55 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
2answers
109 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
1answer
181 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. ...
4
votes
0answers
227 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
0answers
34 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: ...
3
votes
2answers
87 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 ...
7
votes
2answers
951 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 ...
8
votes
2answers
655 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. ...
2
votes
0answers
26 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 ...
3
votes
2answers
67 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? ...
1
vote
1answer
127 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 ...
4
votes
0answers
868 views

Custom animated image control

I have written the following control which allows loading a GIF from embedded resource, file, or raw Image. It allows for more granular control over the direction ...
2
votes
1answer
90 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'...
3
votes
2answers
376 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 ...
3
votes
0answers
56 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
0answers
27 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
1answer
282 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 ...
1
vote
1answer
144 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 (...
4
votes
1answer
986 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: ...
2
votes
2answers
88 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 ...
7
votes
1answer
554 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 ...
6
votes
1answer
304 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 ...
4
votes
1answer
62 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
0answers
63 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 ...
4
votes
2answers
196 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 ...
6
votes
1answer
217 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 ...
5
votes
1answer
101 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. ...
8
votes
2answers
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 ...
3
votes
1answer
119 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 (...
3
votes
1answer
702 views

Using graphics to draw on form, in C#

I have a form, which I want to draw on-top some shapes. To be exact, rectangles and lines. This is the "Redraw" method. I call this method every 100ms from a different thread. ...
-1
votes
1answer
86 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
2answers
47 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: <...
5
votes
0answers
125 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
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
1answer
68 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
2answers
96 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
2answers
102 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
3answers
698 views

Shutdown Delay Program

I wrote this program a while back that would allow me to set a delay, say 3 hours, and when the delay had expired, my PC would turn off. The purpose of it was so I didn't have to leave my PC on all ...
5
votes
2answers
233 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