Visual C++ .NET examples (example source code) Organized by topic






GUI Form /

Button 1CheckBox 1
CheckBoxListBox 1ColorDialog 1
ComboBox 1Dialog 1
ErrorProvider 1Form 2
Label 1ListBox 1
Menu 1MessageBox 1
MonthCalendar 1Mouse 1
NotifyIcon 1Panel 1
PictureBox 1RadioButtons 2
RichTextBox 1SplitContainer 1
StatusStrip 1TabControl 1
TextBox 1ToolStrip 1
TreeView 1

2D /

Buffer 2Coordinates 2
Draw String 2Font 1
GDI 2Image 1
Line 1Region 1
Shape 5TextureBrush 1
Unit 1

Database ADO.net /

Blob 1DataSet 5
DataTable 5DataView 2
OleDbCommand 2OleDbCommandBuilder 1
OleDbConnection 2OleDbDataReader 2
SqlCommand 4SqlConnection 2
SqlDataAdapter 1SqlDataReader 2
SqlDependency 1Stored Procedure 1
Transaction 2

XML /

DOM 3XmlDocument 5
XmlNode 3XmlNodeType 2
XmlReader 5XmlWriter 4
XPath 2XPathNavigator 1

Data Type /

boolean 5Boxing Unboxing 2
Cast 2Char 7
DateTime 3Decimal 6
double 1Enum 8
float 1Hex 2
Integer 3Long 1
Number to String 1Octal 1
Pointer 6short 1
String Format 14String to Number 3
String 20

Class /

abstract class 3Access Modifier 2
attribute 5Casting 3
Constructor 4Destructor 3
IComparable 1IDisposable 1
Inheritance 4initonly 2
interface 13interior_ptr 2
literal 2Member method 1
Nested Class 2Operator Overload 2
Overload 1pin_ptr 1
Property 12ref class 6
reinterpret_cast 1sealed 1
static field 1static method 1
value class 4virtual method 5

Delegate /

Delegate 4Event 5

Network /

Marshal 1ServiceDescription 1
SoapFormatter 1TcpClient 2
TcpServer 3Udp Client 4
Udp Server 2Web Services 1

Reflection /

Assembly 2Attribute 1
Method 4Reflection Util 1
Type 1

Security /

CodeAccessPermission 1FileIOPermission 1
GenericPrincipal 1PermissionSet 1
SecurityManager 2WindowsPrincipal 2

Thread /

Abort 1Join 2
Lock 3Monitor 1
Mutex 1Sleep 1
Thread Data 1Thread Definition 1
Thread Pool 1

Collections /

Array Multi Dimension 2Array Pointer 1
Array 27ArrayList 16
binary_search 1BitArray 8
count_if 1deque 8
Dictionary 13greater 1
Hashtable 7ICollection 4
IEnumerable 2IEnumerator 6
IList 1KeyValuePair 1
LinkedList 11LinkedListNode 2
list 15ListDictionary 4
make_collection 1map 10
max_element 1multimap 1
multiset 5NameValueCollection 6
priority_queue 3queue 8
random_shuffle 1reverse_iterator 2
set 6sort 4
SortedDictionary 1SortedList 10
Stack 5StringCollection 12
Vector 11

Development /

Compile 1Console 5
Convert 1DllImport 3
Document 18Exception 2
IAsyncResult 2main 2
Pointer 3printf_s 1
Process 1ResourceManager 2
ResourceReader 1StringBuilder 7
StringWriter 2Timer 1

Statement /

do while 1finally 3
for each 1for 1
if 1macro 1
switch 1throw 4
try catch 8using 2
while 1

Structure /

Constructor 1Definition 6
Structure Method 1Structure Pointer 1
value struct 1

Function /

Definition 4Function parameter 6
Function Return 1template 1

Generics /

Generic Array 2Generic Class 3
Generic Function 6Generic Interface 3
Generic List 6Generic Property 1

File Directory /

BinaryWriter 1DirectoryInfo 8
FileInfo 7FileStream 5
MemoryStream 4Serializable 2
StreamReader 4StreamWriter 5

Language Basics /

Bitwise Operator 1Comparison Operators 2
Constant 1gcnew 4
gcroot 2namespace 2
nullptl 1