VB.NET Sample Code
-
How to run through multiple DataReader results
by Edward Tanguay
You can save code by piling SQL statements into one SqlCommand and then getting a DataReader with multiple result sets.
-
Capture a Screen Shot
by James Crowley
Demonstrates how to capture a screen shot of the entire desktop, or a particular window in C# or VB.NET.
-
How to access a MySQL database with .NET
by Edward Tanguay
Demonstrates how to connect to a MySQL database with C#.
-
Virtual Stack
by Daniel Okely
This is an implementation of a stack.
-
Clearing TreeView taking too much time
by Palo Mraz
Explores an odd feature of the System.Windows.Forms.TreeView and a simple workaround.
-
User-Friendly Validation using ErrorProvider
by Tim Dawson
Data entry is a very important part of a lot of applications. It is important to validate data as it is entered without disturbing the user. Enter the ErrorProvider component.
-
Get Current Username in VB.NET
by Walter Steed
Demonstrates how to use the GetUserName API in VB.NET
-
Send File to Recycle Bin in VB .NET
by Walter Steed
.NET version of "Send file to Recycle Bin"
-
C# String Functions and Manipulation
by Colin Harman MACITP
Learn how to manipulate C# strings using built-in and custom functions. The code provided shows how to trim, find, search, replace and split strings, convert to upper case and proper case and more.
-
Sending Email With an Attachment
by James Crowley
A simple bit of code demonstrating how to use the MailMessage object to send an email with an attachment.
-
Screen Resolution
by Bharat Nagarajan
Helps you to get the screen resolution from VB.NET
-
List Files in a Directory
by JesusFreak
A little code snippet that lists files in a directory
-
Pinging a host from VB .net
by MstrControl
A class that allows ping a computer.
-
Flatten That Combo Box, Man!
by Stacey Brown
A .NET class written in VB.NET for your own flat combo box.
-
API Samples
by Matthew Taylor
Shows samples of how to use different kinds of APIs. Changing and getting different system settings such as mouse position, beep length and frequency, computer name, user name, drive type, swap mouse button. You will need to create the needed controls on the form before accessing them in code of course.
-
How to “Snap” the Cursor
by Karl Moore
Learn how to move the cursor position to slap bang in the middle of your control.
-
Are You Running in the IDE?
by Karl Moore
Here's how to detect if your .NET code is currently being debugged, or if we're in design mode.
-
Crafty Conversion Between Graphic Formats
by Karl Moore
Think converting images between different formats is complicated in .NET? Think again. Karl shows you how.
-
Random Numbers... That Work!
by Karl Moore
Has all this talk about seeds got you confused? Here's a nice snippet to show you the best way to get random numbers in .NET.
-
The Ordinal Number Function
by Karl Moore
Give numbers their ordinals back.... this function automatically returns the correct ordinal; "st", "nd", "rd", "th" depending on the number you give it.