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
50 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
18 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
81 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
49 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
48 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 (...
3
votes
1answer
263 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: ...
1
vote
2answers
84 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 ...
6
votes
1answer
249 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 ...
3
votes
1answer
58 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
61 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 ...
5
votes
1answer
181 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
150 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 ...
4
votes
1answer
98 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
114 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
85 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
42 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
1answer
178 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
0answers
73 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
837 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
59 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 ...
2
votes
2answers
88 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. ...
1
vote
2answers
99 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 ...
4
votes
2answers
210 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 ...
3
votes
1answer
222 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 ...
4
votes
2answers
197 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
168 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 ...
17
votes
5answers
3k 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 ...
9
votes
2answers
687 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 ...
0
votes
2answers
58 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 ...
2
votes
2answers
112 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
840 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 ...
6
votes
2answers
568 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
412 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
125 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. <...
0
votes
1answer
82 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 ...
10
votes
2answers
5k views

Clearing all controls

I'm clearing all the controls on a windows form with the following ...
3
votes
1answer
120 views

Loading icons in two different sizes

I am loading 3000 individual icons at run time one of my controls uses large icons, the other uses small icons. This works however seems terribly inefficient. The only way I can get the icons to be ...
7
votes
2answers
614 views

2 player TicTacToe

Can I optimize this Tic-tac-toe game or make it smaller? Known optimizations: string turn = "X"; can be changed to ...
1
vote
2answers
420 views

Selecting form controls that are either inside or outside a rectangle

I have a function which loops over the controls on a form and checks to see if it's in a given rect, and then adds it or doesn't add it to a list<>. The ...
7
votes
1answer
535 views

Winform, with a workaround to avoid dependencies

I'm working on a Winform project. We currently have a modular design (shown in the image) in our project. Where on every user action (button clicked or selection changed etc), first we set the Model ...
2
votes
1answer
64 views

Extendable way of providing metadata on a list

We have a winforms application with a lot of grid views. These grids have some basic layout functions (text color, font weight, font style, ....). I need to make sure that other developers can make ...
2
votes
0answers
366 views

Refreshing cell values in visible rows of a VirtualMode DataGridView

I have a DataGridView whose Virtual Mode property is set to True. When values of the underlying list are updated, those updates ...
4
votes
1answer
1k views

PauseOrCancelTokenSource

I added this implementation of PauseToken and PauseTokenSource to my project from this MSDN blog post: Cooperatively pausing async methods Since I will usually be passing in both a PauseToken and a ...
8
votes
1answer
1k views

MVP Passive-View

First of all, I'm really new to the MVP design pattern (Passive-View) and I've been trying to implement it in a WinForms application. Before I'm going any further, I'd be very happy if you guys can ...
4
votes
1answer
535 views

Copy files from three folders into a fourth one

I have a simple WinForm application that copies all files and directories from three folders into a fourth one. All folders are chosen/entered by the user. Security ...
3
votes
1answer
66 views

Find matching image and metadata files, pull data and rename both

My Original - Read date from a file and rename two files using the date github if you want to see behind the scenes. I like taking pictures of birds. Lots of pictures of birds. My camera counts ...
7
votes
2answers
5k views

Banking application for practice

A few weeks ago I have started to teach myself C# and just finished my first little project, a very basic banking application. I don't expect it to be good but would like to get feedback (no matter ...

1
2 3 4 5 6