Click here to Skip to main content
15,886,830 members
Everything / Desktop Programming / Windows Forms

Windows Forms

WinForms

Great Reads

by Josh Smith
A task-oriented review of an animation library and the application which uses it
by Nish Nishant
This articles explains how to implement a TypeDescriptionProvider for a class to support multiple object types using a single class type
by Marc Clifton
Review your project dependencies.
by Nish Nishant
An ExifReader class in C# that supports custom formatting and extraction. StyleCop compliant code, with demos for WPF and Windows Forms.

Latest Articles

by Ralf Meier
The article walks through ShellySceneComponent and ShellyScenesComponent, which allow users to define scenes with multiple actions assigned to a control or controls for Shelly devices.
by Ralf Meier
This article is a continuation of a series on controlling Shelly® devices in a smart home. It introduces a component that works with standard controls without requiring adaptation.
by Graeme_Grant
.NET compliant Silent ClickOnce Update Background Worker Service for Winform, WPF & Console in C# & VB
by Mirnes Mrkaljevic
Make WinForms testable

All Articles

Sort by Updated

Windows Forms 

17 Apr 2023 by OriginalGriff
How to add images to a Winforms Project so they are accessible as resources
11 Jan 2022 by Jo_vb.net
My idea was to host a WPF user control with Ribbon within a WinForm VB.NET project and try to use MVVM pattern.
29 Apr 2020 by honey the codewitch
This tip shows you how to do UI updates without having to worry about locking.
24 Oct 2018 by Tecfield
Collapsible ListView
4 Oct 2018 by Awesh Vishwakarma
By reading this trick, you will be able to update your database from DataGridView through external class instead of writing code on each page.
17 Sep 2018 by adriancs
A tool to backup & restore all MySQL databases in one click
2 Aug 2018 by asiwel
Simple C# methods for saving snapshot images of a WinForm to the desktop
9 Feb 2018 by Tony Zackin
A very simple yet customizable pop-up message box which auto-closes after a specified number of milliseconds.
7 Feb 2018 by Santosh Kokatnur
Adding Checkbox to a List View Column Header in C# WindowsForm application
27 Nov 2017 by Altaf Ansari
Converting XML Data into DataTable and Exporting DataTable into Excel File
25 Jul 2017 by Sergi Ortiz Gomez
Quick tip for capture ENTER key in a Windows Form combobox
18 Dec 2016 by Clivic TR
This are a practical ways to confine inputs into a specific range. The natural thinking is to track them and change. That derives two ways below.
26 Oct 2016 by Midi_Mick
An edit control for the masked input of GUIDs
23 Sep 2016 by Midi_Mick
This is an alternative for "Resolve DesignMode for a user control"
5 Jul 2016 by _Matt_Wilkinson_
How to centralise a Form when using multiple screens
3 Jul 2016 by The Zakies
we will continue the functionality of the hand tool with having a navigator panel which works as a map, we will also have a red rectangle which tells the user where he is actually viewing inside the whole form, also it can be moved to pan the form
29 Jun 2016 by The Zakies
we would create Hand_tool to pan through the drawing form, and we would use a custom cursor of open and closed hands
24 Jun 2016 by The Zakies
in this tut we will create a technique to enable the user to control points within a drawn line, by drawing circles around points of the line , when the user clicks a circle he would control the corresponding point.
20 Jun 2016 by The Zakies
we will build an outline line around the drawn lines so we would test the mouse click on this outline to know which line is selected. and we would in the coming update build a select function inside the move tool
20 Jun 2016 by The Zakies
Learn how to implement a tecnique of a parent form that createes and controls other forms , through the tecnique of using the tab control, also learn how to implement a menu for the tools, and how to add cutom cursor for each tool
7 Jun 2016 by The Zakies
[tut4] how to draw lines & to draw different types on end shapes like rectangle and circle using C#
7 Apr 2016 by The Zakies
Part 3 of a tutorial to show a graphics program using C# using GDI and SVG drag and drop and delete objects
3 Mar 2016 by The Zakies
Tutorial 2 (how to interactively add multiple shapes GDI using linked lists)
19 Nov 2015 by B.O.B.
A simple extension to add an item that has a data source bound to combobox.items
15 Nov 2015 by Midi_Mick
The simplest solution for adding a custom collection of custom objects to the designer
19 Oct 2015 by charles922
Another way to implement Falling Blocks Game
17 Oct 2015 by zidane168
This topic focuses on what is the difference between SendMessage and PostMessage and how to use them?
14 Oct 2015 by cwfong
Make these controls read-only on WinForm
11 Sep 2015 by pgmr_64804
C# Gantt Chart For Winforms
9 Sep 2015 by Vladyslav Chernysh
The goal of this tip is to share knowledge and experience on ActiveX usage in .NET applications (back-end & front-end).
25 Aug 2015 by CharlieFoolsTheComputer
Constraining a form/dialog to a single monitor
5 Aug 2015 by sreeyush sudhakaran
VB.NET code for Base64 Encoding and Decoding of Image files
2 Aug 2015 by Reader Man San
Plug-in Architecture To Work in WinForms MVC + WPF MVVM + ASP.NET MVC + Mobile (Xamarin MVC/PhoneGap MVC) + Win 10 Universal App MVC
28 May 2015 by Robert.Verpalen
DataGridViewGrouper: add grouping functionality to the .NET DataGridView
11 May 2015 by Yvan Rodrigues
A few lines of code to make using the Windows Forms RichTextBox easier to use as a logging window.
10 May 2015 by Peer Adi
This is a liquid container control for displaying liquid level in container or tank.
6 May 2015 by Acharya Raja Sekhar
This tool helps a lot while capturing more number of snapshots. Example: Developers can use this tool to capture the UTR and save all snaps at the end to a Word document or save as individual images.
8 Apr 2015 by basilke7007
How to create rounded edge button (rounded corner button) in Winforms
25 Mar 2015 by TarikHuber
Use STT (SQL Table Toolkit) to bind WinForm Controls to a DataGridview and to define ComboBox data sources
15 Mar 2015 by manchanx
Tidy, generic solution to bind Enums (with or without a DescriptionAttribute) to a ComboBox or other Controls
1 Dec 2014 by TarikHuber
Easy library for checking VAT Numbers of European Companies. Only usable with an German VAT for non German VAT!!!
16 Nov 2014 by Hassan Mokdad
This is a just a small tip to show a simple way of designing the user interface of Windows Forms for Desktops applications.
14 Oct 2014 by Jamie Highfield
WinForms .NET Time Chooser grid control.
7 Aug 2014 by PIEBALDconsult
This is an alternative for "Adding Functionality To .NET Controls"
10 Jul 2014 by IKalai
A Windows Forms toggle button with Android, Windows and iOS like styles.
4 Jul 2014 by Chakravarthi Elchuri
How to use WIA supported scanner using C#
17 Jun 2014 by Vipul Bhatnagar
Create a multilingual application WPF
14 Jun 2014 by Graham Wilson
A method of ensuring that SplitterContainer controls with fixed panels are properly resized when AutoScaleMode is ScaleMode.DPI
26 May 2014 by Serge Weinstock
A ComboBox whose suggestion list is based on loose character search
6 Mar 2014 by Jacky Yiu
Visual cryptography is a cryptographic technique which allows visual information (pictures, text, etc.) to be encrypted in such a way that the decryption can be performed by the human visual system, without the aid of computers.
18 Dec 2013 by Nanda Kumar Chintam
Demonstration of Excel manipulations using C#
25 Nov 2013 by selvaprakash.s
This tip will demonstrate how cookies are passed from one control to another control in C# .NET in authenticated webpage.
7 Nov 2013 by MayurDighe
This tip describes how to fill the PDF Form Template programmatically
12 Sep 2013 by shelby67
Dialog for product key entry
17 Aug 2013 by adriancs
An Office 2010 Style Color Picker for .NET WinForm.
14 Aug 2013 by adriancs
A program/application for learning and writing HTML. Get instant visual effect side by side with your code as you type. Support HTML5, Javascript and CSS3 elements.
5 Jul 2013 by Johnny J.
A sample owner-drawn ComboBox
10 May 2013 by youssef.obeid
This is to show you how to build a Dropdown button for Windows form
6 Apr 2013 by Thomas Daniels
A tip about how to set the position of a Windows Forms MessageBox in C#
6 Mar 2013 by zheng shuo
This tip shows how to share data between two or more forms in a Winforms application.
6 Mar 2013 by wmjordan
Rendering text with OpenType fonts by P/Invoking GDI API in WinForm applications.
28 Jan 2013 by avigodse
This article is created for setting the tab focus on the controls, where the error-provider has error text.
2 Dec 2012 by Bikash Karmokar
Connecting Windows Form Application With ADO.NET in C#
14 Oct 2012 by AnuragTripathi
Convertor for Unicode to Krutidev and vice-versa.
6 Oct 2012 by Frans Jan
This article shows how to save a Windows Form to a PDF file.
18 Sep 2012 by Raje_
This is a simple demo of how to display the number of unique products from a DataGridView.
26 Aug 2012 by Wendelius
The tip shows one way to resolve if a user control is in design mode.
6 May 2012 by Shahin Khorshidnia
Tag is a useful property, but when you need more than a Tag, what will you plan for it?
27 Apr 2012 by Igor Pashchuk, MBA
This is an alternative for "C# Pivot Table"
26 Apr 2012 by coffee_machine
A component to add localized strings to a Form's res'x.
8 Apr 2012 by Sreedeep.S
Serial Communication with the .NET Framework in Winforms
4 Apr 2012 by CodeMajster
A detailed tutorial on how to embed multiple icons and color/animated cursors in VS2010 VB project assembly as native win32 resources.
14 Mar 2012 by R.Tarik
Print you PDF silently using C#
1 Mar 2012 by pipiscrew
nah, try the light one ://at FormLOAD WB.Navigate("about:blank"); //at treeview event private void treeview_AfterSelect(object sender, TreeViewEventArgs e) { WB.Document.Body.InnerHtml = (dR["html"].ToString()); }
4 Feb 2012 by springy76
By using a LinkedList, you can even mimic true recursive behavior without using recursive calls; the order will be "0,3,9,10,4,1,5,11,12,2,6,7,8", then:public static IEnumerable GetRecursive(this IEnumerable source, Func> subSelector){ var...
3 Feb 2012 by Sagotharan Jagadeeswaran
Thanks, I am just changing False to True, And I got Automatically Check TreeView Child Nodes When Parent Is Checked.private void treeView1_AfterCheck(object sender, TreeViewEventArgs e) { if (e.Node.Checked) { ...
3 Feb 2012 by Member 147785
Hello!Here is a small article - Show progress on long-running operations, which describes approach to keep the UI responsive, starting long-running operations in separate thread. This approach is native and without any 3d-party libraries and even without BackgroundWorker.For example, the...
30 Jan 2012 by leppie
Here is yet another alternative (originally from http://xacc.wordpress.com/2009/03/05/tree-traversal-extension-methods/[^]):public static class TreeExtensions{ public static IEnumerable TraverseDepthFirst( this T t, Func valueselect, Func
24 Jan 2012 by intrueder
Extension method to make it easy to retrieve all nodes of a TreeView control.
24 Jan 2012 by Richard Deeming
You can make this slightly more reusable by targeting the IEnumerable interface and providing a function to return the children of each item:public static class EnumerableExtensions{ private static IEnumerable DescendantsAndSelfIterator( IEnumerable source, ...
13 Jan 2012 by johannesnestler
Nice solution agent154, I'd just suggest to implement it as extension methods for data row: (and I don't liked your "error reporting" with the '0' Value - because '0' could be a valid index). But I have to say, even if you don't have a database behind the datatable you can use sorting (LINQ,...
11 Jan 2012 by agent154
A method to move rows within a DataTable
10 Jan 2012 by Grasshopper.iics
I will use a label with font color red just below the text box and will adopt the following code private void textBox1_TextChanged(object sender, EventArgs e) { int min=0,max=256; try { label1.Visible = false; ...
7 Jan 2012 by PIEBALDconsult
A binary search technique to determine which TabPage of a TabControl was clicked
7 Jan 2012 by Manish K. Agarwal
Simple Numeric TextBox to accept digits for a given minimum maximum range
3 Jan 2012 by PIEBALDconsult
Getting the line and position of the cursor in a TextBox
3 Jan 2012 by Lutosław
This method, although it doesn't use binary search, handles Multiline tab pages too.private static intGetTabIndexAt( System.Windows.Forms.TabControl tabControl, System.Drawing.Point point){ int result = -1; if (tabControl != null) { for (int i = 0;...
2 Jan 2012 by Tom Clement
A few notes on this code: Wouldn't you get an exception if the user happens to put in a number bigger than can be stored in an int32? Wouldn't int32.TryParse be better because of this?The control can be initialized with a negative number as a constraint, but it doesn't permit the '-'...
25 Dec 2011 by Juan Davel
Managing Application Scoped Connection Strings
25 Dec 2011 by PIEBALDconsult
OK, here's another way (I found this at http://dotnet.mvps.org/dotnet/faqs/?id=textboxcaretpos&lang=en[^]). [System.Runtime.InteropServices.StructLayoutAttribute (System.Runtime.InteropServices.LayoutKind.Sequential)]private struct ApiXY{ public int X ; public int Y ;}[ ...
21 Dec 2011 by Member 8208766
To me the second method was problematic. After searching, I found an apparently equally good solution:webBrowser1.DocumentText = text;or in your case:webBrowser1.Document.Write("Hello, world!");from here:...
20 Dec 2011 by emolina
Public Sub DisableSound() Dim keyValue As String keyValue = "%SystemRoot%\Media\" If Environment.OSVersion.Version.Major = 5 AndAlso Environment.OSVersion.Version.Minor > 0 Then keyValue += "Windows XP Start.wav" ElseIf Environment.OSVersion.Version.Major = 6 Then ...
30 Nov 2011 by mohanaitec
WinForm DataGridView loading from ObjectCollection.
28 Nov 2011 by Akos Orban
Set Owner of a WPF Window to a Form
22 Nov 2011 by #realJSOP
A useful technique that could be used for winform apps which require a login dialog
22 Nov 2011 by #realJSOP
Allow any number of forms to be used as a main form with easy transitions between forms
20 Nov 2011 by Bernhard Hiller
That's far too obscure.All you need to do is store a reference to the TabPage instance which was removed from the TabPages collection of the TabControl. You may use the form where the TabControl is placed for that purpose.You could also create your own TabControl which has an extra property...