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
9 votes
2 answers
2k views

WinForms Poker (complete project)

I have quite huge question/favor to ask but I hope I can get some useful answers. This is my first complete project, I'm still learning C#, my first programming language. I'm afraid that there will ...
user avatar
  • 8,418
3 votes
1 answer
7k views

Use of Ninject as an IoC container in a WinForms MVC application

I am a relatively experienced WPF developer who has had good exposure to MVVM. I have been developing legacy WinForms applications for a while and have recently been asked to fully re-write a large ...
user avatar
15 votes
1 answer
682 views

Simple dictionary storing/viewing application

A TreeView on the left which just displays a list of files saved by the application. A DataGridViewon the right to display data ...
user avatar
  • 503
2 votes
2 answers
2k views

Insert rows in the datagridview with a dictionary

I would like to improve the function below without calling twice InserisciRigaNote. Before I fill my dictionary. When I compare ...
user avatar
4 votes
1 answer
2k views

Disable and enable text boxes according to the radio button click

Here is a GPA calculator in C#. I am feeling like the code that I write and format are quite long and would like it to be shorter. This program is using radio buttons to enable and disable the text ...
user avatar
6 votes
1 answer
231 views

Dialogue system using an FSM

In short - I've started with C# not so long ago (which means you find a lot of poor written code here) and now I'm aiming to create a dialogue system. Though my code is working as it supposed to, ...
user avatar
6 votes
1 answer
294 views

Populating a listbox in a mock invoice with selected items

So I'm almost 100% certain I've done something wrong simply due to the inefficiency of what I've written, I'm entirely a novice to coding and am working on an assignment for my introductory ...
user avatar
  • 63
1 vote
1 answer
634 views

Browse Folders for Videos

I am a self-taught programmer and would love any advice / suggestions. I wanted to implement some sort of n-tier Architecture, but not sure how to move all my code around. My program will take movies ...
user avatar
5 votes
1 answer
988 views

Load & view movies on a hard drive in Netflix-like UI

I am a self-taught programmer and would like anyone to point out anything that is not the standard or professional way to do things. Any help/advice is greatly appreciated. I would love to post a lot ...
user avatar
6 votes
1 answer
5k views

Paste from Excel to DataGridView

I have this code that helps me to paste data from an Excel file to a Datagridview: ...
user avatar
9 votes
2 answers
353 views

short or simple solution for putting values from label to column in excel

I have a code here that counts the number of fruits from Column B to Column AF (31 days). I used a switch with cases from 1 to 31. I'd like my code to be simpler. ...
user avatar
  • 191
14 votes
2 answers
814 views

Input validation for a user

I have a small Person Domain Model as follows: ...
user avatar
  • 475
2 votes
1 answer
163 views

Creating a user registration form

How should I go about creating a registration page in Windows forms? I can easily create a registration page, but I'm not sure if it's the best way. I'd have a service account that is hard coded, and ...
user avatar
1 vote
1 answer
360 views

Custom DataGridViewColumn to replace a DataGridViewComboBoxColumn

The issue that i'm trying to fix with this code is simple I have a huge dataset and I have to bind it (as readonly) to a DataGridView In that dataset I have some ...
user avatar
  • 385
-1 votes
1 answer
2k views

Simple C# goto alternative [closed]

I heard goto is bad, so I ask someone in this site if my code is better using goto or other alternative ...
user avatar
  • 116
4 votes
3 answers
798 views

Determine payment based in the number of adults, number of children, and some combo box selection

How can I shorten this code with a while loop? Is it possible? cboFrom and cboTo is a combobox. I only know how to do simple ...
user avatar
  • 41
3 votes
1 answer
2k views

Dynamic visual list of images

Situation So I have made a list of PictureBoxes on my form that looks as follows: All images have a panel behind them that is 4px lager (2xp all around the picture box). The images are named ...
user avatar
1 vote
1 answer
2k views

Create Form Controls based on the properties of a class

Is there a better way to create Form Controls for properties of a class? Right now, I iterate through all properties of a class and have a method to create the Form Control for that property based on ...
user avatar
-1 votes
2 answers
222 views

Accessing a list of websites using a configuration read from an XML file [closed]

I have a C# application and a CakePHP website. These communicate between them using GET and (WebRequest) POST method. My problem is that it's happening too fast. I have made a diagram that shows ...
user avatar
  • 193
4 votes
1 answer
6k views

Opening an XML File and Returning the XmlDocument

I'm working on my first Windows Forms tool for a project; this is my first time using C# extensively. Right now, my only objective is to be able to open an XML file and have the resulting XML in hand. ...
user avatar
-1 votes
1 answer
114 views

Extracting Power and Energy out of a slow regex

My WinForms application is a bit slow, I'd like to make it faster. It extracts only the power and energy values out of a string in textBox3, and displays the ...
user avatar
  • 7
11 votes
3 answers
359 views

FizzBuzz in accordance with standards

I wrote FizzBuzz. My aim is to use C# Code Standards correctly, and write flexible code. How can I improve my solution according to code standards? How can it be better in general? ...
user avatar
  • 111
11 votes
1 answer
166 views

Pattern-finding game

This is a game that is supposed to be based on strategy and guessing. The letters need to match in a ABCD fashion on each button on buttons[0] - ...
user avatar
  • 399
4 votes
1 answer
791 views

SQL Permission Handling in WinForms

For my application, I've opted to use Integrated Security with Windows Authentication to access the SQL database. I've created AD security groups for each role and given them ...
user avatar
  • 1,049
4 votes
1 answer
1k views

Tic Tac Toe with winforms

This game works out the basic of a Tic Tac Toe game. I am looking to see if this can be redone in any way to make the code more smaller since this is really big. ...
user avatar
  • 399
24 votes
5 answers
3k views

Console window to debug Windows Applications

Since I was having some difficulties to debug the next step for Scrolly - A (very) simple infinite mouse "scroll", I've decided to make a console-like class that allows to add messages to it. This ...
user avatar
11 votes
3 answers
2k views

Scrolly - A (very) simple infinite mouse "scroll"

Out of fun, and to practice my rusty C# skills, I've made a very basic program. It only has 1 function: When you move the mouse to a side of the screen, it shown on the other side. Like an infinite ...
user avatar
8 votes
2 answers
934 views

Drag and drop single files on different targets for different purposes

I have three text fields (DevExpress ButtonEdits set to read only) on a Windows Forms app. They look like this: They're used by dragging and dropping a single ...
user avatar
  • 181
3 votes
1 answer
659 views

Populate tree from 3 different data sources and show its content

The task is to build a WinForm app which populates a tree from 3 different data sources and shows its content. 1 ComboBox at top - to choose datasource. (File ...
user avatar
8 votes
1 answer
482 views

Winforms Mathematical Operator Label

I wrote a custom class which (atm) displays the +, -, =, x, and ÷ operators inside a circle. Apart from the issue of some symbols not appearing in the exact center (everything except + looks a bit off)...
user avatar
  • 643
5 votes
1 answer
785 views

Preparing a YouTube downloader based on Windows form

The program this function was written for is a Windows forms program. This function downloads videos from the internet one after the other. It runs in a separate thread (so the user can drag the form ...
user avatar
6 votes
2 answers
2k views

Binding Lists of Commits to a DataGridView in Winforms with an MVP architecture

I'm using Winforms and I find this pattern showing up in my code a lot. It works, but I'm unsure if it's best. The goal is to pass an IList of items through a view ...
user avatar
  • 30.7k
5 votes
1 answer
111 views

User can choose to add one of two node types to a treeView, both of which have almost identical settings

There is a context menu that comes up when a user right-clicks on a node in a TreeView. They are then presented with the choice to either add what is called a "RWB" or an "AQ" node to the tree. Both ...
user avatar
  • 51
1 vote
1 answer
89 views

Properly managing a collection from deserialized XML file throughout app's lifetime

I'm developing a WinForms app to manage some settings and profiles for multiple video games. The list of video games is specified by the user, and I'm trying to figure out how to properly maintain ...
user avatar
6 votes
2 answers
243 views

Script that parses the Chase.com page for my recent payments

I wrote this code earlier to parse Chase.com's online transactions page. It's written in WinForms. stepBtn is a button that starts this. ...
user avatar
  • 205
2 votes
1 answer
74 views

Loading a Model from a Database

As you will see from the code below, I have a base model. ...
user avatar
  • 255
7 votes
2 answers
6k views

Controls Edits of DataGridview in Winform

I want to refactor this code that is currently in a partial Form Class and deals with edits made on certain cells in a datagridview (in this case called dgvReplenish). I would like to refactor so ...
user avatar
3 votes
2 answers
1k views

Linq-to-SQL DAL on a Windows Forms project

I just started out a new job as a C# programmer on .NET 3.5. My manager gives me total independence on how I build my modules, which is generally a good thing, but there are minuses too. Having too ...
user avatar
12 votes
1 answer
156 views

Rubberduck "GoTo Anything" Navigation

The next version of rubberduck is going to include a pretty nifty "goto anything" / find symbol navigation tool that lets the user enter an identifier name in a combobox: UI To achieve the ...
user avatar
13 votes
3 answers
173 views

Reordering method parameters

Next release of Rubberduck (should be 1.4) introduces a reorder parameters refactoring, which lets user reorder the parameters of a module (or class) member, and automatically adjust all usages. ...
user avatar
17 votes
5 answers
2k views

Populating a ListView with Items

I populate a ListView with Items. Each Item has data attached to its .Tag property. Over time, I have needed to handle many cases where something would be null or ...
user avatar
  • 273
12 votes
2 answers
248 views

Exploring the code of the Code Explorer

The Code Explorer is a dockable toolwindow that displays a TreeView that shows all opened VBA projects and their respective modules, but unlike the "native" Project Explorer, Rubberduck's explorer ...
user avatar
1 vote
2 answers
13k views

Check before proceeding if the task in BackgroundWorker has completed

I have a Login Form (which has a label that will show status of background process, username and password text boxes, Login and Cancel buttons) along with that I have a background worker to do some ...
user avatar
  • 121
1 vote
3 answers
2k views

Dealing with DB Through EF within Winforms

I have the following code which uses EntityFramework to reach out to a DB and retrieve data to populate into a Winform application gridview. I am still quite new ...
user avatar
  • 315
4 votes
1 answer
4k views

Cancellable progress form using async/await

Introduction: For a project I'm working on I used a BackGroundWorker to lift some heavy tasks away from the UI thread and report progress. For this I created some ...
user avatar
  • 5,553
1 vote
1 answer
1k views

Efficient use of LINQ - Indexing

I have a Class with a List of objects, and those objects contain a list which has lists to objects in the first class, and I'm trying to quickly index them. Simplified: ...
user avatar
3 votes
2 answers
2k views

Is this a thread-safe implementation of background bitmap generation?

For a game implementation, I have a very large overview map with multiple layers (namely base-map / units / highlight & info / fov-shading) of which the first is CPU-intensive to generate. I have ...
user avatar
11 votes
1 answer
376 views

Refactoring my Todo List was on my Todo List. How's my MVC?

This is a follow up to Rolling my own Configuration with UI. I got a lot of great advice about the Configuration system I created, but no one touched on how all of my logic for the UI was in the code ...
user avatar
  • 30.7k
14 votes
4 answers
429 views

Rolling my own Configuration with UI

The Rubberduck Saga continues as I find a need to roll my own configuration. Since the program is really a *.dll and available to several host applications, using app.config is not an option. I ...
user avatar
  • 30.7k
13 votes
3 answers
5k views

Winforms Circular Checkbox

So here is my next creation, a circular checkbox. This is my third custom control, so I'm still learning, but have the basics just about down. Tips and suggestions are most appreciated: ...
user avatar
  • 643

1 2 3
4
5
7