Click here to Skip to main content
14,971,099 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 Joe Dufresne
An easy to use tool to save your Windows Spotlight (lock screen) images for use as desktop wallpaper
by Leif Simon Goodwin
A 3D surface plot control in C#
by GuyThiebaut
Detecting an available update and installing the update via an online download - an alternative to ClickOnce
by Tomaž Štih
A tree drawing algorithm, implemented as C#/WinForms/NET Core control, that produces surprisingly good results with minimal effort

All Articles

Sort by Score

Windows Forms 

Please Sign up or sign in to vote.
4 Jul 2014
Chakravarthi Elchuri
How to use WIA supported scanner using C#
Please Sign up or sign in to vote.
28 Nov 2011
Akos Orban
Set Owner of a WPF Window to a Form
Please Sign up or sign in to vote.
26 Aug 2012
Wendelius
1 alternative  
The tip shows one way to resolve if a user control is in design mode.
Please Sign up or sign in to vote.
5 Jul 2013
Johnny J.
A sample owner-drawn ComboBox
Please Sign up or sign in to vote.
14 Aug 2013
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.
Please Sign up or sign in to vote.
29 Jun 2016
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
Please Sign up or sign in to vote.
19 Feb 2011
#realJSOP
2 alternatives  
Determine the number of unique colors in an image
Please Sign up or sign in to vote.
28 Apr 2010
Keith Barrow
2 alternatives  
If you have a Winforms application that auto loads data, there is no doubt that you’ll have come across the problem of data loading at design time (i.e. when opening the code in the designer). At best, this slows the designer down, at worst it might crash VS and prevent the control from...
Please Sign up or sign in to vote.
26 Jan 2011
#realJSOP
When you need to communicate with the app that contains your ServiceHost object, use custom events
Please Sign up or sign in to vote.
27 Jun 2011
charles henington
1 alternative  
Please Sign up or sign in to vote.
20 Nov 2011
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...
Please Sign up or sign in to vote.
6 Mar 2013
wmjordan
Rendering text with OpenType fonts by P/Invoking GDI API in WinForm applications.
Please Sign up or sign in to vote.
3 Jan 2012
PIEBALDconsult
1 alternative  
Getting the line and position of the cursor in a TextBox
Please Sign up or sign in to vote.
17 Aug 2013
adriancs
An Office 2010 Style Color Picker for .NET WinForm.
Please Sign up or sign in to vote.
6 Jul 2011
Brian C Hart
This tip shows how to add support for New Horizontal Tab Group and New Vertical Tab Group commands to the Window menu of an application using the DockPanel Suite by Weifen Luo, and some other minor improvements to help decided if at least one of your windows is docked to the side of the main form an
Please Sign up or sign in to vote.
25 Mar 2015
TarikHuber
Use STT (SQL Table Toolkit) to bind WinForm Controls to a DataGridview and to define ComboBox data sources
Please Sign up or sign in to vote.
9 Sep 2015
Vladyslav Chernysh
The goal of this tip is to share knowledge and experience on ActiveX usage in .NET applications (back-end & front-end).
Please Sign up or sign in to vote.
8 Jan 2010
dwilliss
Another way to do something like this is to handle the RowPrePaint event and change the background there. The advantage to doing it this way is that if you have thousands of rows, you don't have to set it for every row at the beginning, which could take a few seconds. This way only sets it for...
Please Sign up or sign in to vote.
13 Jul 2010
Dima Popov
A slightly different solution.using System.Runtime.InteropServices;private const int WM_NCLBUTTONDOWN = 0xA1;private const int HTCAPTION = 0x2;[DllImport("User32.dll")]private static extern bool ReleaseCapture();[DllImport("User32.dll")]private static extern int...
Please Sign up or sign in to vote.
15 Jul 2011
Simon Bridge
Full code listing for a very simple but effective Colour-Combo (Color for those in America)
Please Sign up or sign in to vote.
25 Dec 2011
Juan Davel
Managing Application Scoped Connection Strings
Please Sign up or sign in to vote.
30 Jan 2012
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
Please Sign up or sign in to vote.
26 Apr 2012
coffee_machine
A component to add localized strings to a Form's res'x.
Please Sign up or sign in to vote.
14 Oct 2015
cwfong
Make these controls read-only on WinForm
Please Sign up or sign in to vote.
18 Feb 2010
Ron Beyer
If you are designing in a WinForms component, which is anything that derives from Control at some point (Forms, UserControls, panels, etc), then you can use the following code:if (this.Site.DesignMode) //Do stuff[edit]The above will throw an exception if Site is not set (in...
Please Sign up or sign in to vote.
12 Apr 2011
KevinPorter
How about using a Mutex? This should also work for Terminal Services sessions. Use in Program.csstatic Mutex mut;try{ bool isOwned = false; mut = new Mutex(true, Application.ProductName + " MUTEX: {53A4988C-F91F-4054-9076-220AC5EC03F3}", out isOwned); if (!isOwned)...
Please Sign up or sign in to vote.
21 Jun 2011
SergeyT2
You can use Action instead of MethodInvoker as well. And ".Invoke" at the method is unnesessary.public static void ThreadSafeCall(this Control control, Action method){ if (control.InvokeRequired) { control.Invoke(method); } else { method(); ...
Please Sign up or sign in to vote.
7 Jan 2012
PIEBALDconsult
1 alternative  
A binary search technique to determine which TabPage of a TabControl was clicked
Please Sign up or sign in to vote.
22 Nov 2011
#realJSOP
Allow any number of forms to be used as a main form with easy transitions between forms
Please Sign up or sign in to vote.
25 Dec 2011
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 ;}[ ...
Please Sign up or sign in to vote.
21 Dec 2011
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:...
Please Sign up or sign in to vote.
3 Jan 2012
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;...
Please Sign up or sign in to vote.
3 Feb 2012
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...
Please Sign up or sign in to vote.
8 Dec 2009
Love React
How to use WebBrowser, a form, and an MDI parent to open Excel files
Please Sign up or sign in to vote.
30 Nov 2010
MartinW1307
I have for years used the follow to fetch a window to a visible screen.1. Right click the window on the taskbar and select 'Move' (or use the keystrokes Alt-Space, M)2. Move the mouse a bit3. Press "left arrow"4. Move the mouse around - you will see the window outline ;) 5. left click...
Please Sign up or sign in to vote.
6 Dec 2010
Luc Schenkeveld
Alternate 3Right click on the taskbar and use "Show Windows Side by Side"
Please Sign up or sign in to vote.
19 Feb 2011
a_pess
I think we may check if the color is repeated or not, any how this another alternative but in VB.NetPublic Shared Function GetImageColorsCount(ByVal bitmap As Bitmap) As Integer Dim ColorList As New System.Collections.Generic.List(Of Integer) Dim clr As Integer For...
Please Sign up or sign in to vote.
21 Mar 2011
Nitin Singh India
People wonder how do delegates work and the threading issues associated with multicast ones.
Please Sign up or sign in to vote.
29 Jun 2011
Alexandros Pappas
Display of a context menu when pressing the Apps key in a DevExpress GridControl
Please Sign up or sign in to vote.
22 Sep 2011
Armando de la Torre
Use an error log control to validate forms.
Please Sign up or sign in to vote.
2 Oct 2011
Anshul R
You can use BackgroundWorker to do the work and report the progress using:private void backgroundWorker1_ProgressChanged(object sender, ProgressChangedEventArgs e){ this.progressBar1.Value = e.ProgressPercentage;}
Please Sign up or sign in to vote.
28 Sep 2011
Vladimir Vorobiev
This example contains the code to manage the menu of open forms (standard Windows menu). When created, each mdi-child gets a menu item and event handler through which this element is removed from the menu when the corresponding form is closed.private void ShowOrCreateMdiChild(Type formType)...
Please Sign up or sign in to vote.
1 Oct 2011
Rafał Klepacz
private void OpenForm() where T : Form, new(){ T frm = (T)new List(this.MdiChildren).Find(f => f is T) ?? new T() { MdiParent = this }; frm.Show(); frm.Focus();}and usageOpenForm();
Please Sign up or sign in to vote.
7 Oct 2011
Bruce Lee Harrison
The background method is probably the most preferred method, but I've found this one is very easy to implement, and it's just one short line:BeginInvoke(new Action(() => progressBar1.Increment(1)));Place this in your worker thread to report to the UI. Not sure how "good" this is, but it...
Please Sign up or sign in to vote.
3 Feb 2012
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) { ...
Please Sign up or sign in to vote.
14 Mar 2012
R.Tarik
Print you PDF silently using C#
Please Sign up or sign in to vote.
25 Aug 2015
CharlieFoolsTheComputer
Constraining a form/dialog to a single monitor
Please Sign up or sign in to vote.
3 Jul 2016
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
Please Sign up or sign in to vote.
8 Apr 2011
intrueder
Extension method to make any WinForms control to be draggable at runtime
Please Sign up or sign in to vote.
2 Feb 2011
#realJSOP
1 alternative  
How to determine if your .Net app is running in the Visual Studio IDE
Please Sign up or sign in to vote.
6 May 2012
Shahin Khorshidnia
Tag is a useful property, but when you need more than a Tag, what will you plan for it?
Please Sign up or sign in to vote.
6 Apr 2013
Thomas Daniels
A tip about how to set the position of a Windows Forms MessageBox in C#
Please Sign up or sign in to vote.
23 Sep 2016
Midi_Mick
This is an alternative for "Resolve DesignMode for a user control"
Please Sign up or sign in to vote.
20 Jun 2016
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
Please Sign up or sign in to vote.
19 Jan 2016
Graham Wilson
A collection of simple .NET 2.0 controls and utilities.
Please Sign up or sign in to vote.
11 May 2015
Yvan Rodrigues
A few lines of code to make using the Windows Forms RichTextBox easier to use as a logging window.
Please Sign up or sign in to vote.
12 Jun 2010
Kristian Sixhøj
2 alternatives  
A code snippet which makes a borderless form draggable.
Please Sign up or sign in to vote.
28 May 2015
Robert.Verpalen
DataGridViewGrouper: add grouping functionality to the .NET DataGridView
Please Sign up or sign in to vote.
16 Nov 2014
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.
Please Sign up or sign in to vote.
7 Feb 2018
Santosh Kokatnur
Adding Checkbox to a List View Column Header in C# WindowsForm application
Please Sign up or sign in to vote.
6 Nov 2011
RaviRanjanKr
Yet another way to this is as follows: using System;using System.Collections.Generic;using System.Windows.Forms;using System.Threading;namespace OnlyOneInstance{ static class Program { [STAThread] static void Main() { bool...
Please Sign up or sign in to vote.
25 Mar 2011
FDW
Maybe this is helpful, it tries to switch to the first running instance:namespace UltraSimple.Win{ static class Program { [System.Runtime.InteropServices.DllImport("user32.dll")] public static extern bool SetForegroundWindow(IntPtr hWnd); [STAThread] ...
Please Sign up or sign in to vote.
20 Feb 2011
Andrew Rissing
Just a few minor improvements to readability and such...The catch/throw isn't needed here, since you are just throwing it without doing anything in the catch block. A try/finally could have been used on its own.The try/finally isn't necessary because a using statement can achieve the same...
Please Sign up or sign in to vote.
14 Sep 2011
#realJSOP
How to automatically display a Winforms menu when the mouse is hovered over an item
Please Sign up or sign in to vote.
27 Apr 2012
Igor Pashchuk, MBA
This is an alternative for "C# Pivot Table"
Please Sign up or sign in to vote.
4 Feb 2012
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...
Please Sign up or sign in to vote.
24 Jan 2011
Nejimon CR
Make irregular splash screens without writing a single line of code!
Please Sign up or sign in to vote.
22 Nov 2011
#realJSOP
A useful technique that could be used for winform apps which require a login dialog
Please Sign up or sign in to vote.
26 Oct 2016
Midi_Mick
An edit control for the masked input of GUIDs
Please Sign up or sign in to vote.
11 Jan 2012
agent154
1 alternative  
A method to move rows within a DataTable
Please Sign up or sign in to vote.
22 Dec 2010
Vercas
Unfocusable, borderless form, perfect for floating controls!
Please Sign up or sign in to vote.
25 Nov 2013
selvaprakash.s
This tip will demonstrate how cookies are passed from one control to another control in C# .NET in authenticated webpage.
Please Sign up or sign in to vote.
18 Sep 2012
Raje_
This is a simple demo of how to display the number of unique products from a DataGridView.
Please Sign up or sign in to vote.
7 Nov 2013
MayurDighe
This tip describes how to fill the PDF Form Template programmatically
Please Sign up or sign in to vote.
2 Dec 2012
Bikash Karmokar
Connecting Windows Form Application With ADO.NET in C#
Please Sign up or sign in to vote.
8 Apr 2012
Sreedeep.S
Serial Communication with the .NET Framework in Winforms
Please Sign up or sign in to vote.
19 Dec 2010
tumbledDown2earth
1 alternative  
Hiding the form from alt-tab menu
Please Sign up or sign in to vote.
20 Dec 2011
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 ...
Please Sign up or sign in to vote.
4 Apr 2012
CodeMajster
A detailed tutorial on how to embed multiple icons and color/animated cursors in VS2010 VB project assembly as native win32 resources.
Please Sign up or sign in to vote.
8 May 2011
OriginalGriff
The Visual Studio Property pane is a control, which can be used in WinForms like any other, and it provides a simple, easy to use property editor for your classes. However, it is not obvious how to get it to open a browse dialog for a file path property.
Please Sign up or sign in to vote.
8 Mar 2011
Ron Levy
WebCam Application with Scheduling
Please Sign up or sign in to vote.
3 Feb 2011
Alan N
I use the following to insert pauses into console apps when they are vs hosted. In fact it's the final lines in my standard template for a console app to ensure that the console stays visible until I dismiss it.if (AppDomain.CurrentDomain.FriendlyName.EndsWith("vshost.exe",...
Please Sign up or sign in to vote.
26 May 2014
Serge Weinstock
A ComboBox whose suggestion list is based on loose character search
Please Sign up or sign in to vote.
10 May 2013
youssef.obeid
This is to show you how to build a Dropdown button for Windows form
Please Sign up or sign in to vote.
3 Oct 2011
Manfred Rudolf Bihy
Using SendMessage and the PARAFORMAT structure, one can easily change the line spacing in a RichTextBox control
Please Sign up or sign in to vote.
24 Jan 2012
intrueder
3 alternatives  
Extension method to make it easy to retrieve all nodes of a TreeView control.
Please Sign up or sign in to vote.
6 Oct 2012
Frans Jan
This article shows how to save a Windows Form to a PDF file.
Please Sign up or sign in to vote.
18 Dec 2013
Nanda Kumar Chintam
Demonstration of Excel manipulations using C#
Please Sign up or sign in to vote.
7 Jun 2016
The Zakies
[tut4] how to draw lines & to draw different types on end shapes like rectangle and circle using C#
Please Sign up or sign in to vote.
24 Oct 2018
Tecfield
Collapsible ListView
Please Sign up or sign in to vote.
20 Jun 2016
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
Please Sign up or sign in to vote.
6 Mar 2014
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.
Please Sign up or sign in to vote.
9 Feb 2018
Tony Zackin
A very simple yet customizable pop-up message box which auto-closes after a specified number of milliseconds.
Please Sign up or sign in to vote.
15 Jul 2011
BillWoodruff
An interesting change in behavior in VS 2010 Pro ?
Please Sign up or sign in to vote.
17 Jun 2014
Vipul Bhatnagar
Create a multilingual application WPF
Please Sign up or sign in to vote.
6 May 2015
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.
Please Sign up or sign in to vote.
20 Feb 2010
tonyt
Either method is good for testing if you are in the designer, but another problem aside from preventing code execution, is preventing code from being jitted in the Designer. For example, you may reference assemblies or components that are dependent on native code, which cannot be loaded into any...
Please Sign up or sign in to vote.
18 Feb 2011
harbor
Manual Scroll Panel in a Panel or UserControl with AutoScroll=false
Please Sign up or sign in to vote.
18 Jun 2011
RakeshMeena
1 alternative  
This extension can be used to update controls in a thread safe manner. This method requires a MethodInvoker delegate as input parameter. It just checks whether the control is on a different thread than the caller.
Please Sign up or sign in to vote.
22 Nov 2011
#realJSOP
A useful technique that could be used for winform apps which require a login dialog
Please Sign up or sign in to vote.
26 Oct 2016
Midi_Mick
An edit control for the masked input of GUIDs
Please Sign up or sign in to vote.
11 Jan 2012
agent154
1 alternative  
A method to move rows within a DataTable
Please Sign up or sign in to vote.
22 Dec 2010
Vercas
Unfocusable, borderless form, perfect for floating controls!
Please Sign up or sign in to vote.
25 Nov 2013
selvaprakash.s
This tip will demonstrate how cookies are passed from one control to another control in C# .NET in authenticated webpage.
Please Sign up or sign in to vote.
18 Sep 2012
Raje_
This is a simple demo of how to display the number of unique products from a DataGridView.
Please Sign up or sign in to vote.
7 Nov 2013
MayurDighe
This tip describes how to fill the PDF Form Template programmatically
Please Sign up or sign in to vote.
2 Dec 2012
Bikash Karmokar
Connecting Windows Form Application With ADO.NET in C#
Please Sign up or sign in to vote.
8 Apr 2012
Sreedeep.S
Serial Communication with the .NET Framework in Winforms
Please Sign up or sign in to vote.
19 Dec 2010
tumbledDown2earth
1 alternative  
Hiding the form from alt-tab menu
Please Sign up or sign in to vote.
20 Dec 2011
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 ...
Please Sign up or sign in to vote.
4 Apr 2012
CodeMajster
A detailed tutorial on how to embed multiple icons and color/animated cursors in VS2010 VB project assembly as native win32 resources.
Please Sign up or sign in to vote.
8 May 2011
OriginalGriff
The Visual Studio Property pane is a control, which can be used in WinForms like any other, and it provides a simple, easy to use property editor for your classes. However, it is not obvious how to get it to open a browse dialog for a file path property.
Please Sign up or sign in to vote.
8 Mar 2011
Ron Levy
WebCam Application with Scheduling
Please Sign up or sign in to vote.
3 Feb 2011
Alan N
I use the following to insert pauses into console apps when they are vs hosted. In fact it's the final lines in my standard template for a console app to ensure that the console stays visible until I dismiss it.if (AppDomain.CurrentDomain.FriendlyName.EndsWith("vshost.exe",...
Please Sign up or sign in to vote.
26 May 2014
Serge Weinstock
A ComboBox whose suggestion list is based on loose character search
Please Sign up or sign in to vote.
10 May 2013
youssef.obeid
This is to show you how to build a Dropdown button for Windows form
Please Sign up or sign in to vote.
3 Oct 2011
Manfred Rudolf Bihy
Using SendMessage and the PARAFORMAT structure, one can easily change the line spacing in a RichTextBox control
Please Sign up or sign in to vote.
24 Jan 2012
intrueder
3 alternatives  
Extension method to make it easy to retrieve all nodes of a TreeView control.
Please Sign up or sign in to vote.
6 Oct 2012
Frans Jan
This article shows how to save a Windows Form to a PDF file.
Please Sign up or sign in to vote.
18 Dec 2013
Nanda Kumar Chintam
Demonstration of Excel manipulations using C#
Please Sign up or sign in to vote.
7 Jun 2016
The Zakies
[tut4] how to draw lines & to draw different types on end shapes like rectangle and circle using C#
Please Sign up or sign in to vote.
24 Oct 2018
Tecfield
Collapsible ListView
Please Sign up or sign in to vote.
20 Jun 2016
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
Please Sign up or sign in to vote.
6 Mar 2014
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.
Please Sign up or sign in to vote.
9 Feb 2018
Tony Zackin
A very simple yet customizable pop-up message box which auto-closes after a specified number of milliseconds.
Please Sign up or sign in to vote.
15 Jul 2011
BillWoodruff
An interesting change in behavior in VS 2010 Pro ?
Please Sign up or sign in to vote.
17 Jun 2014
Vipul Bhatnagar
Create a multilingual application WPF
Please Sign up or sign in to vote.
6 May 2015
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.
Please Sign up or sign in to vote.
20 Feb 2010
tonyt
Either method is good for testing if you are in the designer, but another problem aside from preventing code execution, is preventing code from being jitted in the Designer. For example, you may reference assemblies or components that are dependent on native code, which cannot be loaded into any...
Please Sign up or sign in to vote.
18 Feb 2011
harbor
Manual Scroll Panel in a Panel or UserControl with AutoScroll=false
Please Sign up or sign in to vote.
18 Jun 2011
RakeshMeena
1 alternative  
This extension can be used to update controls in a thread safe manner. This method requires a MethodInvoker delegate as input parameter. It just checks whether the control is on a different thread than the caller.
Please Sign up or sign in to vote.
19 Dec 2010
tumbledDown2earth
Trick for dragging the form while clicking on the client area
Please Sign up or sign in to vote.
14 Jun 2014
Graham Wilson
A method of ensuring that SplitterContainer controls with fixed panels are properly resized when AutoScaleMode is ScaleMode.DPI
Please Sign up or sign in to vote.
11 Sep 2015
pgmr_64804
C# Gantt Chart For Winforms
Please Sign up or sign in to vote.
12 Jun 2010
Anshul R
The original snippet I made is in VB.NETProtected Overrides Sub WndProc(ByRef e As Message) MyBase.WndProc(e) If e.Msg = &H84 AndAlso e.Result = &H1 Then e.Result = &H2 End SubI used Reflector to translate it to C#protected override void WndProc(ref Message...
Please Sign up or sign in to vote.
2 Oct 2011
Manish K. Agarwal
3 alternatives  
Single Instance Form in a MDI application
Please Sign up or sign in to vote.
18 Nov 2010
ola halvorsen
3 alternatives  
When going from a multimonitor environment to a single monitor, windows get stuck on the other screens
Please Sign up or sign in to vote.
17 Sep 2018
adriancs
A tool to backup & restore all MySQL databases in one click
Please Sign up or sign in to vote.
4 Feb 2010
Gordon Kushner
Say you need capture an event for a control in a User Control and you are not permitted to change the control itself.You can hook into control events, even for private controls with this code://In a Windows Form//Get the private control cboSomePrivateControl from the user control's...
Please Sign up or sign in to vote.
10 May 2015
Peer Adi
This is a liquid container control for displaying liquid level in container or tank.
Please Sign up or sign in to vote.
15 Jan 2014
Yvan Rodrigues
Please Sign up or sign in to vote.
15 Nov 2015
Midi_Mick
The simplest solution for adding a custom collection of custom objects to the designer
Please Sign up or sign in to vote.
19 Dec 2010
meaningoflights
Tried it in VB.NET Winforms app, but no luck. It's still shown in the alt-tab menu:Protected Overrides ReadOnly Property CreateParams As System.Windows.Forms.CreateParams Get Dim cp As CreateParams = MyBase.CreateParams cp.ExStyle = cp.ExStyle Or &H80 ...
Please Sign up or sign in to vote.
20 Sep 2011
Ctznkane
Assuming you only want a single instance of a form type, I'd suggest you add a Dictionary(Of Type, Form). ShowOrActiveForm would have a single parameter of Type and would be a subroutine.The Form object could be found based on a ContainsKey. The rest of the ShowOrActiveForm function would be...
Please Sign up or sign in to vote.
6 Mar 2013
zheng shuo
This tip shows how to share data between two or more forms in a Winforms application.
Please Sign up or sign in to vote.
1 Dec 2014
TarikHuber
Easy library for checking VAT Numbers of European Companies. Only usable with an German VAT for non German VAT!!!
Please Sign up or sign in to vote.
24 Jun 2016
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.
Please Sign up or sign in to vote.
19 Mar 2011
charles henington
5 alternatives  
Run Only One Copy Of Application
Please Sign up or sign in to vote.
27 Nov 2017
Altaf Ansari
Converting XML Data into DataTable and Exporting DataTable into Excel File
Please Sign up or sign in to vote.
2 Aug 2015
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
Please Sign up or sign in to vote.
7 Jan 2012
Manish K. Agarwal
2 alternatives  
Simple Numeric TextBox to accept digits for a given minimum maximum range
Please Sign up or sign in to vote.
14 Oct 2012
AnuragTripathi
Convertor for Unicode to Krutidev and vice-versa.
Please Sign up or sign in to vote.
14 Oct 2014
Jamie Highfield
WinForms .NET Time Chooser grid control.
Please Sign up or sign in to vote.
8 Apr 2015
basilke7007
How to create rounded edge button (rounded corner button) in Winforms
Please Sign up or sign in to vote.
7 Apr 2016
The Zakies
Part 3 of a tutorial to show a graphics program using C# using GDI and SVG drag and drop and delete objects
Please Sign up or sign in to vote.
12 Sep 2013
shelby67
Dialog for product key entry
Please Sign up or sign in to vote.
2 Jan 2012
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 '-'...
Please Sign up or sign in to vote.
17 Feb 2010
William Winner
First, why would you want to change the ToolTip text during the PopUp? Why not hook the MouseHover of the control that you want to change the ToolTip? Dynamically setting the ToolTip does not require hooking the PopUp event.How about: public partial class Form1 : Form { ...
Please Sign up or sign in to vote.
28 Jun 2011
George Swan
Couldn't the class RegEdit be replaced by one simple method?private void SetKey(bool enableTaskManager) { using ( var mKey = Registry.CurrentUser.CreateSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System")) {...
Please Sign up or sign in to vote.
29 Apr 2020
honey the codewitch
This tip shows you how to do UI updates without having to worry about locking.
Please Sign up or sign in to vote.
26 Aug 2009
Henry Minute
Never code whilst holding scissors. That is not what is meantby the 'cut' in cut and paste.
Please Sign up or sign in to vote.
15 Mar 2015
manchanx
Tidy, generic solution to bind Enums (with or without a DescriptionAttribute) to a ComboBox or other Controls
Please Sign up or sign in to vote.
30 Mar 2011
tlhIn`toq
Just because we like C# doesn't mean we can't borrow from other .NET languages. I've always had good luck and less complication using VB's single instance methodology in my C# applications. This code would go in your program.cs file:/// /// We inherit from...