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
5 votes
2 answers
251 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 ...
user avatar
  • 63
5 votes
1 answer
248 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 ...
user avatar
  • 2,324
20 votes
5 answers
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 ...
user avatar
  • 20.3k
10 votes
2 answers
833 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 ...
user avatar
1 vote
2 answers
84 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 ...
user avatar
  • 237
3 votes
2 answers
144 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 ...
user avatar
  • 111
2 votes
4 answers
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 ...
user avatar
7 votes
2 answers
1k 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 ...
user avatar
-2 votes
1 answer
576 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 ...
user avatar
  • 111
2 votes
2 answers
213 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. <...
user avatar
  • 21
1 vote
1 answer
140 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 ...
user avatar
11 votes
2 answers
7k views

Clearing all controls

I'm clearing all the controls on a windows form with the following ...
user avatar
4 votes
1 answer
171 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 ...
user avatar
  • 51
8 votes
2 answers
869 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 ...
user avatar
  • 295
1 vote
2 answers
574 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 ...
user avatar
8 votes
1 answer
735 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 ...
user avatar
  • 195
2 votes
1 answer
69 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 ...
user avatar
  • 123
2 votes
0 answers
481 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 ...
user avatar
  • 425
4 votes
1 answer
2k 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 ...
user avatar
  • 425
9 votes
1 answer
2k 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 ...
user avatar
  • 93
5 votes
1 answer
635 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 ...
user avatar
3 votes
1 answer
80 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 ...
user avatar
  • 7,099
8 votes
2 answers
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 ...
user avatar
  • 81
2 votes
2 answers
2k views

Creating lists of Card objects

I need to create two lists of Card objects in C#. A Card class is defined as: ...
user avatar
  • 677
3 votes
1 answer
2k views

Function that loads a random image using an array of paths to images

I have created a program that generates a random image from a folder of all the world's flags. First, it generates an image as it loads, then it can keep randomizing the shown image if the user clicks ...
user avatar
1 vote
0 answers
119 views

ChatApp (Web API, Windows Forms and Azure SQL Database)

I have been working on chatApp (my first app in c#). I used Azure SQL Database, ASP.NET Web API and WinFroms. The app works very well with no errors Please give me your professional opinion and ...
user avatar
  • 11
1 vote
0 answers
94 views

Interface prototype that draw on windows forms chart

now I'm working on some code that will control external FPGA and draw some data on WF chart. It has complete functionality now, but I'm interested in better practices of doing interfaces. I have UI ...
user avatar
  • 13
2 votes
1 answer
86 views

Form for showing diaper prices

Here's a small program to tell our employees the price of our diapers. Is there a way such as an int array or an optimized way to set brandLevelNumber & sizeLevelNumber to the selected items in ...
user avatar
2 votes
1 answer
982 views

Prevent recursive calls in WinForm event handlers

Changing TextBox.Text within the TextBox.TextChanged event can trigger a recursive call to the same event handler. My class <...
user avatar
6 votes
3 answers
764 views

Simple Photo Gallery Image Formatting Tool

I created a little tool to help me take a folder of images and convert them into a properly formatted structure for a photo gallery I'm working on. This includes keeping the original high res photo, ...
user avatar
3 votes
1 answer
55 views

Loading and parsing WinForms menus using LINQ

I'm refactoring a WinForms utility program for building and testing regular expressions. The program has a menu item which lists the RegexOptions enumeration, ...
user avatar
  • 131
1 vote
0 answers
143 views

News crawler for Google

This is one of my first "real" application using C#, so I'm probably doing a lot of things wrong. I made a simple news crawler, which uses Google to search for news articles of multiple companies. ...
user avatar
  • 2,572
3 votes
1 answer
2k views

Cloning Windows Forms controls from a template

In a recent project I needed a way to clone windows forms controls from a template which had predefined Size, Font, etc. Since ...
user avatar
  • 8,418
3 votes
2 answers
4k views

Is ThreadPool QueueUserWorkItem best option for handling event? [closed]

I have a WinForms application that has value change event coming from ble device. The event can be hit from more than one device also one device can send a notification to event in every 4 secs. ...
user avatar
2 votes
2 answers
2k views

Unit conversion application

I have a form with listboxes used for unit conversions. I'm using the UnitsNet package. Here are my questions: Is this the proper approach? If any changes must be made to this code, what are they? <...
user avatar
  • 21
1 vote
0 answers
81 views

Merging/Chaining WebRequests

This code is used to login and check if the user has premium, and if so, add it to a ListView that then enables premium options. Is there a better way to link all of these web requests and just make ...
user avatar
-4 votes
1 answer
1k views

Winforms tree view checking/unchecking

How can I improve the tree searching algorithm, or can I? ...
user avatar
19 votes
6 answers
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 (...
user avatar
  • 191
2 votes
3 answers
3k views

A weather application

I have recently picked up c# using visual studio and set myself a project to create a weather application. I would like a peer review of my code so I find areas where I can improve and learn more best ...
user avatar
  • 327
6 votes
3 answers
2k views

Checking whether textboxes have data

I always end up creating a quick return statement above a code block if the simple condition of textbox null fields are found. Naturally, these tend to build up the more controls are added. Now I'm ...
user avatar
  • 291
2 votes
1 answer
957 views

Winforms tools for selection of items using ComboBox - binding datasource

This is mi UserControl containing ComboBox and few buttons for selecting and manipulating collection of items which implement simple interface IHasHeader (just ...
user avatar
  • 309
3 votes
2 answers
116 views

Update/Insert/Delete on a particular database table

I'm updating a solution that I wrote a while ago. I've got a WinForm that does Update/Insert/Delete on a particular database table. I've got all of the database access code in the form. Is this bad ...
user avatar
8 votes
3 answers
943 views

Car generation algorithm

I have an algorithm which generates some cars (quote unquote) and displays them using Graphics. I would like to know if my code is using Random correctly, and if it has any memory leaks. Or if there ...
user avatar
  • 371
19 votes
3 answers
575 views

“How are you spending your time on the computer?” Part 2

In my previous question I got some pretty good suggestions which really improved the overall performance of the controls, but I decided to extend the application and add some more features : You can ...
user avatar
  • 8,418
38 votes
4 answers
7k views

"How are you spending your time on the computer?"

I've made a Windows Forms application to track all of the processes running on my machine and it also saves the time an application is "active", an active application is the one that is on focus ...
user avatar
  • 8,418
3 votes
1 answer
720 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. ...
user avatar
3 votes
1 answer
294 views

Looping through the values of two ComboBoxes by pressing a button

I have a C# application where I have implemented the MVP pattern. On one of my forms I have two ComboBoxes with values through which I loop with a button press. The first ComboBox contains different ...
user avatar
6 votes
2 answers
6k views

Creating multiple threads to process items in a listview

The goal is to pick items from a listview, do some web related task with the information and then update the UI with the returned information from the web request. The problem is with having multiple ...
user avatar
  • 63
6 votes
2 answers
593 views

Memory test in windows forms

I've made a memory test game in windows forms, where you need to find and match 2 cards with the same images. It has 3 difficulties : Easy - 4 different pairs of cards, no time limit, no mistakes ...
user avatar
  • 8,418
-1 votes
1 answer
65 views

Creating points in specific size [closed]

The method is in a new class and i use it from form1: In the top of the new class: public int numberOfPoints = 100; The class Init method: ...
user avatar

1
2
3 4 5
7