Browse by Tags

All Tags » WinForms (RSS)
This post details first how to build a list containing the data to display in a WinForms TreeView control. Then it demonstrates how to use recursion to populate the TreeView control from the list. [For information on populating a TreeView control from...
with no comments
Filed under: , , , ,
If you are building a WinForms application and want to style your text, you may want to use the RichTextBox control instead of the standard TextBox control. This post provides some of the common techniques required to style text in a RichTextBox control...
4 comment(s)
Filed under: , , , ,
If you are using XML in a WinForms application you may find the need to display the XML data in a DataGridView. Let's take this XML: <states>     <state name="California">        ...
The same several questions often come up in the forums regarding the basics of building a user control with VB.NET or C#. The goal of this post is to answer those questions. There are three basic types of WinForms user controls that you can create: Extended...
1 comment(s)
Filed under: , , , ,
Though this is not necessarily a common requirement, this post demonstrates the following techniques. Converting a text string to an array. Passing data from one form to another on a constructor. Picking a unique set of random numbers. Using the set of...
with no comments
Filed under: , , ,
It is often necessary for one form in your WinForms application to pass information to another form in your application. Though there are multiple ways to pass the data, this post focuses on using a form constructor. Take a simple case, on Form1 there...
2 comment(s)
Filed under: , , , ,
As stated here , you use object binding in a WinForms application by following these steps: 1. Build the business objects for your application. 2. Define a business object data source in the Windows Application project containing your user interface....
As stated here , you use object binding in a WinForms application by following these steps: 1. Build the business objects for your application. 2. Define a business object data source in the Windows Application project containing your user interface....
If you have a data in a Windows Forms DataGridView, you may want to use some color to highlight specific rows of the grid to draw in the user’s attention. In this example, the code paints a border around a specific row and sets the background color. In...
3 comment(s)
Filed under: , , , ,
There are often times that you need to find specific controls on a Windows Form (WinForm). For example, you may want to find all of the TextBoxes to clear their contents, set their background color, or hook up events. You may want to find all of the checkboxes...
5 comment(s)
Filed under: , , , ,
There are many things in VB.NET and C# that are very similar. So if you know that basic syntax of both languages, it is relatively easy to convert a few lines of code from one to the other. Not so much with events. This is one area where it is easy to...
2 comment(s)
Filed under: , , , ,
This post describes how to populate a WinForms TreeView control from an XML file assuming you are targeting the .NET Framework Version 3.5. The XML file used in this example looks like this: <States>   <State name="California">...
9 comment(s)
Filed under: , , , , ,
My prior post demonstrated how to bind to a list of month names. Once the user picks the desired month, you may want to provide a list of valid dates to pick a date in that month. For example: 1-30 for September and 1-31 for July. You can accomplish this...
Visual Studio comes with DateTimePicker and MonthCalendar controls that provide a standard looking calendar for the user to pick a date. But there are times when these controls don’t provide the features you need. For example, say you want to ask the...
The Enum keyword allows you to define a standard set of named constants for use in your application. Sometimes you may want to present this same list of  values to your user. You can display the set of Enum values in a ComboBox or ListBox using data...