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
1
vote
0answers
139 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
311 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
79 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 ...
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
105 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
0answers
191 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: ...
4
votes
1answer
180 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. ...
3
votes
2answers
85 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
611 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
23 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
1answer
108 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 ...
2
votes
1answer
78 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
270 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
24 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
226 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 ...
3
votes
2answers
66 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
116 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
853 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
498 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 ...
4
votes
1answer
60 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 ...
6
votes
1answer
211 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
2answers
182 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
1answer
100 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 (...
-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
44 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
1answer
276 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
0answers
119 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 ...
5
votes
2answers
228 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 ...
4
votes
1answer
334 views

Drawing shapes in a GDI window

I've been tasked with writing a windows form application that offers some options to modify the drawing of shapes within another window. I have very little experience with event-driven programming and ...
5
votes
2answers
243 views

Portrait Painting Genetic Algorithm

Inspired by this article. I've been trying to learn more C# and OOP. Here is my take on a genetic algorithm as described in the article. Here are some of the results flower jelly lighthouse beach ...
5
votes
1answer
232 views

A Day at the Races. Racetrack Betting App

I recently began learning C# and I picked up Head First C# as a starting point. One of the first projects they have you build, without the code provided, is a racetrack betting app. The project first ...
20
votes
5answers
4k views

House plan design (Head First C#)

I've been working through the book Head First C# and this is an exercise from chapter 7, which is about interfaces and abstract classes. Note that the class design was mandated by the authors, I'm ...
10
votes
2answers
769 views

Calculate subtotals and totals from a form with many decimal values

I've got 17 currency fields on a form and need to do some calculations with their values. I wrote this method some time ago and have come back to try and refactor it to make it more efficient and/or ...
1
vote
2answers
72 views

A WinForm application that filters users

I built a small WinForm application that has checkboxes to filters users with different properties. Each user has a name, color and number. With the program you can filter by color or name the users ...
3
votes
2answers
136 views

Assign a value to combobox depend upon other combobox value

I have a windows form in C# project that keeps some information. I created a bunch of textbox and combobox dynamically, depend upon user input. Consider, I have a list of 10 combobox whose values ...
2
votes
4answers
1k views

Using JSON file for employee pay data

I'm looking for some feedback on my code here. I want to eliminate duplicating the code through the different button_clicks. I'm thinking with a method but nothing ...
8
votes
2answers
852 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 ...
-2
votes
1answer
551 views

Data entry User form Application - winforms

Background: I'm designing a system Data entry form using c# as front end and sql server 2008 as backend database. In this app I'm basically, just reading/writing to the database My issue: I never ...
2
votes
2answers
192 views

A 3 digit stopwatch

I decided to make a stopwatch as I decided it would be useful, and also as a challenge to learn more about how forms work. I'd just like some simple advice as to anything I can do better, thank you. <...
1
vote
1answer
112 views

Dictionary to generate control names

I have found myself referencing controls on a form (think Windows forms but more proprietary) by hard-typing their names in over and over again. Often I'll have a number of similar controls which ...

1
2 3 4 5 6