Tuesday, March 19, 2013

Code sample to display the available drives on your computer in VB.NET

Code sample to display the available drives on your computer in VB.NET


Here is an example written in Visual Basic that displays available drives on a computer. Few lines are enough to get the information. Add lines in your code to enhance your program if you wish.

Code sample to display the available drives on your computer in VB.NET


Thursday, March 14, 2013

VBA

I'd like to make a small announcement.

I will try to include a greater presence in VBA. I noticed on the France websites and French forums that they mostly need information on Visual Basic for Application (VBA)

Personally, VBA is not a language that I use today actually. I prefer Visual Basic. NET because it uses the SDK Framework DOTNET which includes a range of features common in Windows. Based programming with Framework is also independent of the language used: VB.NET, C #, J #, etc..

Next time I will discuss a topic, I will try to write another with a code for VBA or VB6. I'll probably use Excel as an example program for VBA functions.

Note that I will continue to post topics and code examples VB.NET 2005, VB.NET 2008, VB.NET 2010, VB.NET 2012.

Saturday, March 9, 2013

How to convert a collection to array

How to convert a collection to array

In today's example, we will try to send the items from a ListBox's collection to a regular array with Visual Studio. NET (Visual Basic 2005, 2008, 2010, 2012).

The wrong technique would be the most intuitive: the loop. The loop is to go through all the elements one by one. This technique, although it is easy to understand but is very long and the program used in this blog will prove it.
The second technique is to copy the all the handles from the collection of items in the ListBox to the array. This is what we learn at school the first year.

How to convert a collection to array

Thursday, March 7, 2013

Example ProgressBar in Visual Basic

Example ProgressBar in Visual Basic


Uses the ProgressBar to animate your program with actions such as stop, pause and resume his work are essential steps to good ProgressBar. Bad use of a ProgressBar can slow your program or make your program inaccessible.
I introduce two examples of ProgressBar in this article. The first one is a very simple case perfect for programmers who enjoy working in sequential programming as opposed to event-driven programming.


ProgressBar without Thread


Saturday, March 2, 2013

Create a shortcut using a computer code

Create a shortcut using a computer code

There are several ways to create a shortcut in Windows. All these methods converge to the use of Shell named Shell32. Relatively long time, even before the arrival of Windows XP, the file shell32.dll was used to provide many features that are now basic in the operating system Windows. This is the file that contains a number of icon used in Windows. What we do with the Shell32 is to use to create a Windows shortcut.
Create a shortcut