C# - Controls

Edit TreeNode Example 1
Date : 14 Feb 2010
Views : 1488

This code snippet shows how to edit a treenode label.

Get Selected Node From TreeView
Date : 08 Jan 2010
Views : 843

This code snippet gets the selected Node Path from a treeview control

TreeView From XML
Date : 08 Jan 2010
Views : 288

This code snippet loads an xml file into a DataSet object. A for each loop is used to loop through the dataset and add a TreeNode object to the treeview control.

Navigate Rows In DataGridView
Date : 30 Dec 2009
Views : 885

This code snippet allows you to navigate through a DataGridView control. The navigation buttons select a row and the details button gets the values for the currently selected row and displays it in a message box.

Simple PrintDocument Example
Date : 30 Dec 2009
Views : 987

This code snippet shows how to use the PrintDocument class to print documents. It uses the PrintPreviewDialog to show the preview of the document a button to print the docuemnt.

Get TabPages From TabControl
Date : 29 Dec 2009
Views : 315

This code snippet gets a collection of TabPages from a TabPageCollection object.

Add Nodes To TreeView Control With Node Icons
Date : 23 Dec 2009
Views : 753

This code snippet shows how to add nodes with icons to a treeview control.

Add Nodes To TreeView Control
Date : 23 Dec 2009
Views : 300

This code snippet shows how to add nodes and sub nodes to a treeview control.

Load Directories And Files In TreeView Control
Date : 25 Dec 2009
Views : 619

This code snippet shows how to load directories and sub directories and files into a tree control.

ComboBox DataSource From XML
Date : 19 Nov 2009
Views : 1025

This code snippet shows how to add items to a ComboBox control using a DataSet object, which reads an XML file.


New Snippets

Highlight Input Element On Focus Javascript JQuery

This code snippet shows how to highlight an input element when it has focus and remove the highlight when it loses focus.

Calculate Age C# Miscellaneous

This code snippet shows how to calculate an age from a date of birth.

LINQ Example 2 C# LINQ

This linq example shows how to query a List object.

Sliding Tab Control Javascript JQuery

This code snippet shows how to develop a simple tab control, that slides tab pages when you click onto a tab.

LINQ Example 1 C# LINQ

This code snippet uses where to find all elements of an array that is less than 10.

File Exists Visual C++ File Manipulation

This code snippet determines if a file exists.

XML Example 1 Ruby XML

This code snippet shows how to loop through an XML string.

Simple MySQL Class To Query Database Java Database

The following code snippet shows how to create a simple MySql class that can be used to create a connection to the database server and execute queries which return a ResultSet object.

Connect To MySQL Database Java Database

This code snippet shows how to connect to a MySQL database server. You will need to download Connector/j.

File Viewer Example Java Controls

This code snippet shows how to open a file for reading and display the data into a JTextArea component.

JMenu With ActionListener Example Java Controls

This code snippet shows how to add an ActionListener to a JMenu component.

JMenuBar Example Java Controls

This code snippet demonstrates how to use the JMenuBar component and how to add menu items using the JMenu and JMenuItem components.

MD5 Message Digest Example 1 Java Security

This code snippet shows how to use the MessageDigest class to get an instance of the MD5 MessageDigest. This code snippet does not return a 32 character string.

Check If File Is Hidden Java File Manipulation

This code snippet checks if a file is hidden.

Check If File Exists Java File Manipulation

This code snippet checks if a file exists. If it does, it displays its absolute file path.

What Others Are Viewing

Highlight Input Element On Focus Javascript JQuery

This code snippet shows how to highlight an input element when it has focus and remove the highlight when it loses focus.

LINQ Example 2 C# LINQ

This linq example shows how to query a List object.

Sliding Tab Control Javascript JQuery

This code snippet shows how to develop a simple tab control, that slides tab pages when you click onto a tab.

LINQ Example 1 C# LINQ

This code snippet uses where to find all elements of an array that is less than 10.

File Exists Visual C++ File Manipulation

This code snippet determines if a file exists.

Top C# Snippets

This snippet shows how to develop a custom panel which is semi transparent by overriding CreateParams and the OnPaint method of the Panel control.

TThis code snippet gets the filename and path of a selected file using the FileOpenDialog Class.

This snippet adds items to a listview control. It loops through the files in the C:\ drive and displays the filename in the listview control.

This sinppet opens an image for reading as bytes. The bytes are then placed into a memorystream which is used to create a bitmap image of the bytes. The image is then set as the forms background image.

This snippet uses the TripleDESCryptoServiceProvider Class to encrypt a string and save it to a text file. The key to decrypt the file is also saved into a seperate text file.

This code snippet gets the filename of a selected file from the Open File Dialog and displays it in a message box.

This snippet checks to see if a file exists using the FileInfo Class.

This code snippet will get the computers IP address.

This simple snippet creates a connection to an SQLServer.

This simple snippet demonstrates how to use the IEnumerable interface to loop through a custom collection using the foreach loop.