VB.Net examples (example source code) Organized by topic

Windows Presentation Foundation /

3D 17AccessText 4Animation 75Application 10
ApplicationCommands 13ArcSegments 2BackgroundWorker 2Binding 30
BitmapEffect 20Border 3Brush 21BulletDecorator 1
Button 57Canvas 33CheckBox 6Clip 1
CollectionViewSource 5Color 22ComboBox 8Command 11
Common Dialog 1ContextMenu 1ControlTemplate 9Cursor 3
DataContent 2DataTemplate 5DockPanel 13DoubleAnimation 5
DrawingGroup 1Ellipse 25Event 21EventTrigger 15
Expander 4FlowDocument 37Font 8Frame 5
Geometry 33Glyphs 1Grid 46GridSplitter 7
GroupBox 2HierarchicalDataTemplate 1Hyperlink 2Image 24
ImageBrush 38InlineUIContainer 1InputGestureCollection 1ItemsControl 4
IValueConverter 3Key Event 19Label 6LayoutInformation 1
Line 11LinearGradientBrush 12ListBox 42ListView 8
Margin 2Matrix 10MediaElement 9Menu 13
MessageBox 5Mouse 24MultiDataTrigger 1NavigationWindow 1
ObjectDataProvider 5ObservableCollection 4Padding 2Page 9
Panel 3PasswordBox 1Path 35Polygon 13
Polyline 13Popup 6Print 3ProgressBar 6
RadialGradientBrush 9RadioButton 7Rectangle 27RepeatButton 3
Resource 34RichTextBox 11RoutedCommand 13ScrollBar 1
ScrollViewer 7Slider 9Span 9SpellCheck 1
StackPanel 18StatusBar 7Storyboard 12Stroke 23
Style 27StyleSelector 1SystemParameters 1SystemSounds 1
TabControl 5TextBlock 36TextBox 28Thread 16
Timer 3ToggleButton 2ToolBar 4ToolTip 7
Transform 21TreeView 5UI Element 16UniformGrid 3
ValidationRule 2Viewbox 7VisualBrush 8Window 38
WrapPanel 6Xaml 26XmlDataProvider 3

Data Structure /

Array Multi Dimension 14Array Preserve 1Array ReDim 3Array Search 22
Array Sort 17Array 41ArrayList 29ArraySegment 1
BitArray 11CaseInsensitiveComparer 1Collection 11CollectionBase 2
CollectionsUtil 1Column Map 1CompareTo 2ConcurrentBag 1
ConcurrentQueue 1ConcurrentStack 1Connection 2Dictionary 21
Enumerable 13HashSet 13HashTable 15HybridDictionary 1
IComparable 3IComparer 2IConvertible 2IDisposable 2
IEnumerable 3IFormatProvider 1LinkedList 6LinkList Yours 1
List Yours 5List 64ListDictionary 4NameObjectCollectionBase 8
NameValueCollection 5OrderedDictionary 2Queue Yours 1Queue 12
ReadOnlyCollectionBase 3Sort 1SortedDictionary 23SortedList 38
Stack Yours 1Stack 6StringCollection 5StringEnumerator 1
Tree Yours 1

Generics /

Generic Class 4Generic Delegate 1Generic Dictionary 2Generic Function 1
Generic Interface 1Generic List 2Generic Tree 2

Class /

Abstract Class 2Class Define 4Class Type 2Clone 2
Constructor 8Extension 1Hash Code 1Inheritance 4
Instance Variables 1Interface 10Me 1Member Function 1
Operator Overload 1Overload 2Overridable 3Override 2
Polymorphism 2Private 2Property 7Protected 1
ReadOnly 4Shadows 1Shared 5ToString 3

Database ADO.net /

Access Connection String 2Access Data Delete 1Access Data Insert 1Access Data Read 1
Access Data Update 1Access Database 2ADO.net Exception 3Alias 1
Data Bind to ComboBox 1Data Bind to DataGrid 3Data bind to Label 1Data bind to ListBox 2
Data Bind to TextBox 3Data Provider 5Database ListBox 2Database ListView 3
Database NULL 1Database Reader 5Database to SOAP 1Database to XML 5
Database Utility 2DataColumn 2DataGrid 6DataSet Read 2
DataSet to Binary 1DataSet Update 4DataSet XML 4DataTable 1
DataView 1Db2 1Encrypt Database Data 2Fill DataSet 1
Filter 1MySQL 2ODBC 2OleDb Adapter 1
OleDb SQL Server Connection String 1OleDb Store Procedure 2OleDb Table Schema 2OleDbCommand Parameter 1
OleDbConnection 1OleDbDataReader 2OleDbException 1Oracle 2
OracleConnectionStringBuilder 2Scalar Data 3Sql Data Adapter 2Sql Data Type 3
SQL Server Connection String 2Sql Server Store Procedure 4SqlCommand Builder 1SqlCommand Create 3
SqlCommand Delete 2SqlCommand Drop 2SqlCommand Insert 4SqlCommand Parameter 4
SqlCommand Select 6SqlCommand Update 2SqlConnection 8SqlDataReader 8
Table Column 3Table Relation 3Table Schema 2Transaction 6

File Directory /

Binary File Read 8Binary File Write 12CryptoStream 1Cypher Decypher File 4
DeflateStream 2Directory 40DirectoryInfo 22Drive 10
DriveInfo 2File Drag Drop 1File Lock 1File Open Mode 1
File System Watcher 3File System 3File 46FileInfo 26
FileIOPermission 1FileMode 1FileOptions 1FileSecurity 2
FileStream 18FileSystemInfo 1FreeFile 1GZipStream 3
IsolatedStorageFile 1Memory Stream 4Path 4Serialize Object 7
Serialize to XML 2Special Directories 7Stream Action 1Stream Reader 9
Stream Writer 23Stream 10StringReader 1StringWriter 4
TempFile 1Text File Read 11Text File Write 14TextReader 1


All 2AndAlso 1Anonymous Object 6Any 3
Average 3Count 6Distinct 5Enumerable 1
Except 2First 4FirstOrDefault 3From 4
Func 3Group 5Intersect 3Lambda 5
Let 1Max 6Min 4Order 9
Query 19Reverse 1Select 27SequenceEqual 3
Single 1SingleOrDefault 1Skip 3SkipWhile 1
Sum 5Take 5TakeWhile 2ToArray 1
Union 3Where 13


Action Handler 1Anchor 2Background Worker 1Button 7
CheckBox 2CheckBoxList 5ComboBox 2Container Control 1
Context Menu 1Control Inheritance 2Control Owner Draw 2Control Subclass 2
Control 8Cursor 3DataGridView 2DataRow 1
Date Time Picker 3Dialog Color Chooser 3Dialog File Save Open 6Dialog Folder Browser 3
Dialog Font 4Dialog Print 2Dialog Your Own 4Dock 3
DomainUpDown 2Drag Drop 9Drag Move 1Error Provider 1
Form Event 2Form Inheritance 2Form OnPaint 4Form Owner 1
Form Redraw 1Frame Form 6Frame Icon 1Frame Special 9
GroupBox 2GUI Basics 1GUI Event 4Helper Provider 2
Image List 1Label Multiline 1Label 5Layout Panel 1
Layout 3LinkLabel 6ListBox 12ListView 12
MDI 6Menu 11MessageBox 4Month Calendar 4
MsgBox 1Notify Icon Tray 2NumericUpDown 3Paint Mode 3
Panel 3Password 1PictureBox 5PopupMenu 1
Print Document 3Print Preview 6Print Setting 6Print Setup Dialog 1
Progress Bar 3Property Grid 2Radio Button 5ReDo UnDo 1
Resources 5RichTextBox 4Rtf format 2Ruler 1
Screen Capture 2Scrollable Control 1ScrollBar 4SDI 2
SendKeys 1Splash Screen 1Split Container 2Status Bar 4
System Font 5System Icons 1TabControl 3TextBox Special 2
TextBox Validation 4TextBox 6ToolBar 2ToolStrip Menu 1
Toolstrip 4Tooltip 1TrackBar 1TreeView 9
User Control 2

Event /

Focus 1Key Action 4Mouse Draw 1Mouse Enter Leave 1
Mouse Move 2

2D /

Arc 3Area Combination 5Arrow 1Bezier 4
Bitmap 5Bmp 2Brush 6Clip 6
Color 6Curve 3Drag Draw 1Draw Image 3
Draw String 7Ellipse 2Fill Mode 1Font Metrics 1
Font Paint 7Gif 1Gradient 16Graphic Path 10
Graphic State 1Graphics Path Iterator 1Hatch Brush 3Icon 1
Image Animator 2Image File 1Image 6Interpolation Mode 1
JPG 1Line Alignment 1Line Compound 1Line Dash 3
Line Join 2Line Smooth Mode 1Line 4LineCaps 4
Matrix 1Paint Size 2Path String 1PathGradientBrush 1
Pen Alignment 2Pen Join 1Pen 7Pie 2
Ploygon 1PNG 1Public 2Rectangle 4
Region 1Rotate 3Scale 9Shape 1
Shear 2Smooth 3Star 2String Format Paint 8
String Trim Paint 1Text Contrast 1Text Layout 2Text Rendering Hint 2
Texture Brush 5Texture 4Tiff 1Transform 5
Translate 2ttf File 1Wmf 4

Network Remote /

Dns 9Domain Name 1Email 1HttpWebRequest 3
IP Address 9Message Receiver 1Message Sender 1Remote asynchronus 1
Remote Basics 3Remote Factories 1Remote Life Time 1Remote Mode 2
Remote Object 1Remote Soap Server 1SOAP Envelope 1SocketAddress 1
SocketPermission 2TCP Client 1TCP Server 3UDP Client 14
UDP Server 1URI 30UriBuilder 5Web Page 4
Web Request 17WebClient 3WebException 1WebHeaderCollection 5
WebPermission 12WebResponse 8

Thread /

Buffer 1Lock 1Producer Consumer 3Suspend Resume 1
Thread Abort 1Thread Basics 4Thread DeadLock 1Thread Join 3
Thread Priority 2Thread Resume 1Thread State 2Thread Status 1
Thread Suspend 1Thread Synchronize 4Thread Wait 1


DOM 3Namespace 4Read XML File 2XML Attribute 26
XML Database 1XML DataGrid 2XML DataSet 3XML File Creation 6
XML File Read 9XML Node 51XML Schema 44XML Serialize 5
XML String 1XML Transform 7XML Tree 5XML Validation 8
XmlConvert 7XmlDeclaration 1XmlDocument 20XmlElement 2
XmlImplementation 1XmlNode 20XmlProcessingInstruction 1XmlQualifiedName 1
XmlReader 52XmlResolver 3XmlSchemaSet 1XmlTextReader 18
XmlTextWriter 12XmlUrlResolver 1XmlWhitespace 1XmlWriter 25
XPath 7XPathDocument 2XPathNavigator 48


Aggregate 1Descendants 5Namespace 1Query 15
XAttribute 23XComment 1XContainer 14XDocument 34
XElement 64XML Edit 23XML Load 11XML Save 4
XNamespace 26XObject 10XPath 7

Security /

AsnEncodedDataCollection 1Cryptography 6DESCryptoServiceProvider 2MD5 1
RSAPKCS1SignatureFormatter 1Security 3X509Certificate2Collection 1

Windows System /

Clipboard 9Email Client 1Environment Setting 15Event Log 2
Excel 2Management 1ManagementClass 3Memory 1
Process 16Registry 3System Data Type 1System Web Browser 1
User 3Volumn 1Web Favorite 4Window Message 2
WndProc 1

Application /

Painter 1Text Editor 2Web Browser 1

Internationalization I18N /

ASCIIEncoding 14CultureInfo I18N 16Encoding 44NumberFormat 3
NumberFormatInfo 27NumberStyles 11RegionInfo 8UnicodeEncoding 7
UTF8 File 1UTF8Encoding 8

Date Time /

Date Format 8Date Operation 34Date Time Format 32Date Time Function 6
Date Time Parse 21Date Time 83DateTimeOffset 4TimeSpan 17
TimeZone 5TimeZoneInfo 31

Development /

Application 2Assert 1BitConverter 30Calendar 23
Command Line 5Console Format 29Console 34Convert to Boolean 13
Convert to Byte 16Convert to Char 11Convert to Decimal 13Convert to Double 12
Convert to Int16 15Convert to Int32 16Convert to Int64 15Convert to SByte 14
Convert to Single 13Convert to String 29Convert to UInt16 17Convert to UInt32 15
Convert to UInt64 16Convert 19Debug 1Decoder 4
Environment 25Err Number 2Event 2Exception Catch 6
Exception Message 4Exception Stack 2Exception System 4Exception Yours 4
FormatNumber 1Garbage Collection 12GetType 5GregorianCalendar 9
GUID 4Is Value Type 1Late Binding 1Math Function 41
Object 15OperatingSystem 3Password 1Random 23
Reflection 15Regular Expressions 52SecureString 1SerialPort 7
Sound 1String Format 5StringInfo 1Symmetric Algorithm 1
Timer 2Version 2

Data Types /

BigInteger 103Boolean 10Byte 31Char 44
Complex 53Convert from String 38Data Type Convert 22Data Type 15
Decimal Format 15Decimal Parse 4Decimal 36Double Format 36
Double Parse 8Double 26Enum Format 11Enum 44
float 4Hex 9Integer Format 32Integer Parser 2
Integer 25Long 9NumberStyles 3Numeric Format 69
Oct 1SByte 12Short 1Single 26
String Compare 26String Search 13String Split 14String 107
Tuple 7UInteger 1ULong 3UShort 1

Language Basics /

Action 2And 2AndAlso 2As 2
Attribute 3Boxing UnBoxing 1ByRef 8ByVal 9
Cast 1Catch Exception 3Character Trmming 12Const 5
Delegate 11Do Until 2Do While 5Exit Try 1
Exit 3Finalize 3Finally 2For Each 3
For 11Function Parameter 4Function Recursive 4Function 3
Goto 4If 7IIf 1Is 1
Lambda 7Macro 2Main Function 2Mod 2
Not 2nullable 3Operator Logic 3Or 1
OrElse 2Overflow 1Select 9StringBuilder 45
Structure 9Throw 7Variable Scope 3Variable 1
While 1With 1Xor 2