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
6 votes
4 answers
214 views

2-Player Chess in WinForms V.2 (With Separation of Concerns)

Introduction After getting initial feedback on my first working version of this Chess WinForms game here, I have used the suggestions and comments from there to come up with this new version, trying ...
Shinglington's user avatar
3 votes
2 answers
318 views

2-Player Chess in WinForms

Introduction I decided to program a two player Chess game in C# windows forms to help me to improve my programming skills and OOP skills. I have come to a working finished program (as far as I can ...
Shinglington's user avatar
0 votes
1 answer
62 views

Fill TextBox from ListBox on click

I have a form in a WinForms application that has a Textbox called txtSupplier, a button called btnSrchSuppliers, a label called <...
user10191234's user avatar
4 votes
1 answer
254 views

Bouncing balls program with speed up/speed down boxes and lines which change direction of ball

I'm new to C#, background in Ada, C. This is my second lab in a course, output works correct but I feel like I've missed something about OOP. I've asked for feedback from lab 1, but didn't get any. ...
Jackiie's user avatar
  • 53
1 vote
1 answer
177 views

WinForms Most effective way to Rearrange Custom Controls in a FlowLayoutPanel?

I am creating a video parser in C# WinForms. You select files, they get parsed then a custom control (ViewWideNarrow ) is created showing the video's name, duration and so forth, which is then added ...
user19430329's user avatar
5 votes
1 answer
359 views

Simple Ellipse Collision Mini Game

I am doing an exercise to help me understand C#and OOP. The exercise is supposed to teach me about ...
Darke's user avatar
  • 163
2 votes
1 answer
336 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 ...
Ammar Talal's user avatar
0 votes
0 answers
122 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 ...
Gokhan's user avatar
  • 133
1 vote
3 answers
1k 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 ...
Jimmy293288's user avatar
0 votes
1 answer
98 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: ...
E235's user avatar
  • 237
0 votes
1 answer
165 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 ...
Tamal Banerjee's user avatar
4 votes
1 answer
370 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 ...
Tommaso's user avatar
  • 93
1 vote
3 answers
323 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 ...
Tamal Banerjee's user avatar
4 votes
2 answers
156 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 ...
pacmaninbw's user avatar
  • 23.5k
3 votes
3 answers
116 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 ...
pacmaninbw's user avatar
  • 23.5k
2 votes
2 answers
141 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 ...
Tamal Banerjee's user avatar
0 votes
2 answers
168 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 ...
Mr Cat Chap's user avatar
3 votes
4 answers
133 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)...
Ablac's user avatar
  • 33
1 vote
0 answers
745 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 "...
JimmyHu's user avatar
  • 3,974
3 votes
1 answer
1k 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 ...
Gokhan's user avatar
  • 133
1 vote
1 answer
92 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 ...
JimmyHu's user avatar
  • 3,974
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 ...
Joshua White's user avatar
2 votes
2 answers
129 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 ...
RaviKumar's user avatar
4 votes
0 answers
361 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 ...
Tytal124's user avatar
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: ...
Eduards's user avatar
  • 225
4 votes
1 answer
195 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. ...
Eduards's user avatar
  • 225
3 votes
2 answers
148 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 ...
Eduards's user avatar
  • 225
8 votes
2 answers
789 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. ...
Randy's user avatar
  • 487
2 votes
0 answers
37 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 ...
Pablo Aguirre de Souza's user avatar
1 vote
1 answer
358 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 ...
Eduards's user avatar
  • 225
2 votes
1 answer
442 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'...
Eduards's user avatar
  • 225
3 votes
2 answers
1k 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 ...
Eduards's user avatar
  • 225
3 votes
0 answers
69 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 ...
Sebastien Chemouny's user avatar
2 votes
0 answers
35 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,...
Rubens Farias's user avatar
4 votes
1 answer
543 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 ...
yuga's user avatar
  • 81
3 votes
2 answers
82 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? ...
Spaz's user avatar
  • 83
1 vote
1 answer
249 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 (...
Eduards's user avatar
  • 225
4 votes
1 answer
2k 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: ...
user avatar
2 votes
2 answers
220 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 ...
Glazbee's user avatar
  • 145
7 votes
1 answer
814 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 ...
gordkyn's user avatar
  • 73
4 votes
1 answer
104 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 ...
Sinesters's user avatar
1 vote
0 answers
76 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 ...
Veverke's user avatar
  • 171
6 votes
1 answer
240 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 ...
Avinash Reddy's user avatar
4 votes
2 answers
664 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 ...
Sunil Edupuganti's user avatar
5 votes
1 answer
107 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. ...
Owl's user avatar
  • 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 ...
AJD's user avatar
  • 2,346
3 votes
1 answer
125 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 (...
Aris Koutsoukis's user avatar
-1 votes
1 answer
92 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 ...
Evan Quinn's user avatar
-2 votes
2 answers
64 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: <...
Lorenzo Belfanti's user avatar
6 votes
1 answer
453 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 ...
Sofia Rodrigues's user avatar

1
2 3 4 5
7