|
|
|
SearchFileOnPath - Searching a file on the system
|
Total Hit (2698) |
«Code LangId=2»<System.Runtime.InteropServices.DllImport("kernel32")> Shared Function _
SearchPath(ByVal tartPath As String, ByVal fileName As String, _
ByVal extension As String, ByVal bufferLength As Integer, _
ByVal buffer As System.Text.StringBuilder, ByVal filePart As String) As
....Read More |
Rating
|
|
|
|
|
|
Building arrays on the fly
|
Total Hit (2868) |
VB.NET supports the creation of arrays on-the-fly, by using the New operator. For example, look at the following code, that uses GDI methods to display few connected lines
«Code LangId=2»
' Get the Graphics object from the form.
Dim gr As Graphics = Me.CreateGraphics
' Draw three straight line
....Read More |
Rating
|
|
|
BinToDec - Convert from binary to decimal
|
Total Hit (3674) |
«Code LangId=2»' convert from binary to decimal
Function BinToDec(ByVal value As String) As Long
' we just need a call to the Convert.ToInt64 static method
Return Convert.ToInt64(value, 2)
End Function
«/Code»
|
Rating
|
|
|
|
|
How to assign ItemData to combobox / listbox in VB.net
|
Total Hit (9841) |
There is no ItemData property in VB.net for ComboBox and ListBox but you can use another approach which will give you same functionality of ItemData.
Use following code to test how you can assign ItemData. ItemData is generally used to store Id related to the Item of list.
....Read More |
Rating
|
|
|
Running ILDASM from inside Visual Studio .NET
|
Total Hit (3021) |
Nothing beats ILDASM when it's time to understand what your VB.NET or C# compiler actually emits. In this case you should prepare a desktop shortcut to ILDASM so that you can run it quickly, and then open a Windows Explorer window on the Bin directory of your project, so that you can easily drag you
....Read More |
Rating
|
|
|
Convert a binary, octal, or hexadecimal value to decimal
|
Total Hit (4001) |
The Convert class offers a few static methods that let you easily and quickly convert a binary, octal, or hexadecimal number(stored in a String) into the equivalent Byte, Short, Integer, or Long value. These are the methods in question:
«Code LangId=2»Dim b As Byte = Convert.ToByte(value, fromB
....Read More |
Rating
|
|
|
|
|
Retrieve Windows and System directories
|
Total Hit (3107) |
In VB.NET you don't need to call the GetWindowsDirectory and GetSystemDirectory API functions to retrieve the path the Windows and System directories. Retrieving the System directory is as simple as calling the Environment.SystemDirectory property:
«Code LangId=2»
Dim sysDir As String = Environm
....Read More |
Rating
|
|
|
|
Ask a Yes/no question and return a Boolean
|
Total Hit (2828) |
«Code LangId=2»
' Ask a Yes/no question
' returns True if the user replies "Yes"
' Example: MessageBox.Show(AskYesOrNo("Do you like me?", "ME", True))
Function AskYesOrNo(ByVal text As String, ByVal title As String, _
ByVal defaultAnswer As Boolean) As Boolean
Dim defButton As Messa
....Read More |
Rating
|
|
|
|
|
Mouse clipping with the Cursor class
|
Total Hit (2147) |
The Clip property of the System.Windows.Forms.Cursor class represents the rectangle within which the mouse cursor is confined, or Nothing if the mouse can move over the entire screen. This rectangle is in screen coordinates, so you must do some conversions if you want to confine the mouse to an obje
....Read More |
Rating
|
|
|
How Do I...Pass an Array From .NET Code to VB6 Code?
|
Total Hit (708) |
This example demonstrates how to use a .NET object from a Visual Basic 6.0 application. The same technique can be used to create the object from any COM application including those built with Visual C++ 6.0, VBScript or JScript.
|
Rating
|
|
|
|
How Do I...Execute Custom Code During Installation?
|
Total Hit (886) |
An application can consist not only of the traditional program files, but also of associated resources such as message queues, event logs, and performance counters that must be created on the deployment destination. You can configure your application to create these resources when the application is
....Read More |
Rating
|
|
|
Use .NET Forms as Popup Windows
|
Total Hit (2270) |
This article provides a reusable class which you can use to convert a form into a popup which works in the same way as the drop-down portion of a ListBox or the popup controls for picking colours or tables in Office. In addition to wrapping all the functionality you need to ensure the popup is cance
....Read More |
Rating
|
|
|
A .NET Implementation of the ZoomIn Utility
|
Total Hit (2183) |
The ZoomIn Utility enables you to look at any area of the screen and capture the display. This can be an excellent way to snip graphics from other applications or to work out the exact details of how other controls are drawn. A copy of this is provided along with Visual Studio as a tool and also as
....Read More |
Rating
|
|
|
How Do I...Count rate of change?
|
Total Hit (942) |
Windows performance counters enable your applications and components to publish, capture, and analyze the performance data that applications, services, and drivers provide. You can use this information to determine system bottlenecks and fine-tune system and application performance. For example, you
....Read More |
Rating
|
|
|
How To Recursively Search Directories by Using Visual Basic .NET
|
Total Hit (1556) |
This article demonstrates through code how to recursively search subdirectories for files, starting with a root directory. A search string is specified so that you can search for files that match a certain criteria. Each part of the code is explained as necessary. A working code sample is also provi
....Read More |
Rating
|
|
|
ADO.NET: Populate a DataSet from a Database
|
Total Hit (588) |
Getting data from a database is easy, and working with data is easier than before. If you want the results from a database as a forward only, read-only stream of data, you can execute a command and retrieve the results using the DataReader. For examples on how to use a DataReader, see Retrieve Data
....Read More |
Rating
|
|
|
Monitoring File System Events
|
Total Hit (1270) |
In some applications like file system explorers, file managers etc. it becomes necessary to keep an eye on file system changes. In traditional tools like VB6 this task usually required some third party component or Windows APIs. In .NET the FileSystemWatcher class from System.IO namespace provides e
....Read More |
Rating
|
|