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






Windows Presentation Foundation /

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

Data Structure /

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

Generics /

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

Class /

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

Database ADO.net /

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

File Directory /

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

LINQ /

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

GUI /

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

Event /

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

2D /

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

Network Remote /

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

Thread /

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

XML /

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

XML LINQ /

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

Security /

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

Windows System /

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

Application /

Painter 1Text Editor 2
Web Browser 1

Internationalization I18N /

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

Date Time /

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

Development /

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

Data Types /

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

Language Basics /

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