Determine the Windows version
You don’t need to call any Windows API function in VB.NET to determine which version of Windows your application is running on, because this information is exposed by the Environment.OSVersion
You don’t need to call any Windows API function in VB.NET to determine which version of Windows your application is running on, because this information is exposed by the Environment.OSVersion
You can easily retrieve information about the current user by means of a few properties of the Environment class. The Environment.UserName returns the name of the user; the Environment.UserInteractive property
The GetFolderPath method of the Environment class lets you retrieve the path of several important system directories. For example, here’s how you determine the path of the Desktop directory for
‘ Determine which element of an option button control array was selected’ Returns -1 if no control has been selected’ Use : OptSelected = GetSelectedOption(Option1)Function GetSelectedOption(Opt As Object) As Integer
‘ This class does the owner drawing of a MenuItem to draw a color box.’ The class inherits from MenuItem, thus the ColorMenuItem objects’ can be added to a parent
Sometimes you may need to hide or show some pages of a TabControl according to the information you want to show, basing on the currently logged-in user for example (users
‘ Not all fonts support the same styles. This function takes in ‘ input a font family and a font style, and returns a font style’ which is safe for
When you resize a ListView control (this happens automatically if the ListView is docked to the form, and the user resizes the form), it’s nice to have the last column
You can extract RGB values out of a 32-bit color value by using the integer division and the MOD operators, but there is a much more effective way, based on