We’re rewarding the question askers & reputations are being recalculated! Read more.

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
0answers
25 views

Mouse move event outside of form [on hold]

I am creating a 'C#' WinForm application and I want to detect mouse move when the mouse is outside the form. I already tried to create new thread that continually calculate the mouse coordinate, it ...
3
votes
1answer
54 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
59 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
158 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
128 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
97 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
107 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
41 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
169 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
51 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
481 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
54 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
85 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
97 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
191 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
158 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 ...
0
votes
0answers
119 views

Using an N-Tier architecture for a dynamic CRUD user control system

I want to design a flexible dynamic system for a client with standard data-entry screens and CRUD UserControls I dont know whether ...
4
votes
2answers
167 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
138 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
626 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
57 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
103 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
620 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
432 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
323 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
107 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
78 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
4k views

Clearing all controls

I'm clearing all the controls on a windows form with the following ...
3
votes
1answer
93 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
469 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
351 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
423 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
63 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
295 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
784 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
887 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
509 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
61 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
4k 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 ...
2
votes
2answers
983 views

Creating lists of Card objects

I need to create two lists of Card objects in C#. A Card class is defined as: ...
3
votes
1answer
1k 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 ...
1
vote
0answers
95 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 ...
1
vote
0answers
88 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 ...
2
votes
1answer
81 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 ...
1
vote
1answer
627 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 <...
5
votes
3answers
739 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, ...
2
votes
1answer
42 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, ...