|
|
WindowsVersion - The version number of the operating system
|
Total Hit (1973) |
Just copy and paste the following code into Form code window
«code LangId=1»Private Type OSVERSIONINFO
dwOSVersionInfoSize As Long
dwMajorVersion As Long
dwMinorVersion As Long
dwBuildNumber As Long
dwPlatformId As Long
szCSDVersion As String * 128
End Type
Priva
....Read More |
Rating
|
|
|
|
|
|
|
|
|
NdxShellSort -Sort Indexed Arrays using ShellSort
|
Total Hit (2826) |
«Code LangId=1»' Indexed ShellSort of an array of any type
'
' Indexed Sorts are sort procedures that sort an index array
' instead of the main array. You can then list the items in
' sorted member by simply scanning the index, as in
' For i = 1 To numEls: Print arr(ndx(i)): Next
'
' NUMEL
....Read More |
Rating
|
|
|
DirExists - Check that a directory exists
|
Total Hit (3282) |
«Code LangId=1»
' Return True if a directory exists
' (the directory name can also include a trailing backslash)
Function DirExists(DirName As String) As Boolean
On Error GoTo ErrorHandler
' test the directory attribute
DirExists = GetAttr(DirName) And vbDirectory
ErrorHandler:
....Read More |
Rating
|
|
|
GetAllFiles - Search files in a directory or directory tree
|
Total Hit (4727) |
«code LangId=1»Private Sub Command1_Click()
Dim col As Collection
'//Get all files from C:\ (No sub folder) which are older than 5 days and newer than 30 days
Set col = GetAllFiles("c:\", "*.*", False, 30, 5)
For Each f In col
Debug.Print FileDateTime(f) & "=>" & f
....Read More |
Rating
|
|
|
|
MK? And CV? - Convert numbers to strings and back
|
Total Hit (3146) |
«Code LangId=1»
' This group of routines convert a numeric value into a string
' that contain the internal representation of the number.
' They can be useful when converting outdated QuickBasic programs,
' because that language supported these functions that were
' never ported to Visual Basic
....Read More |
Rating
|
|
|
Check whether the user is working off-line
|
Total Hit (3481) |
Internet Explorer offers the possibility to simulate an Internet connection with the off-line mode. If you want to know if off-line mode is on or off you can use InternetQueryOption API.
«Code LangId=1»
Const INTERNET_OPTION_CONNECTED_STATE = 50
Const INTERNET_STATE_DISCONNECTED_BY_USER = &H10
....Read More |
Rating
|
|
|
A dual use of a lookup query
|
Total Hit (2437) |
Usually in your application you use two different types of lookup query; the first one is for retrieving a page of records (or all records) to populate a pick list, the other one is to retrieve a single record, i.e. for decoding a code description while user is typing it in a textbox. So, if your qu
....Read More |
Rating
|
|
|
Using CallByName with nested objects
|
Total Hit (3206) |
Sometimes Microsoft documentation can be, well lacking is a kind word, and one is reluctant to call tech support when they smoke your credit card first, and ask questions later.
My problem was that the CallByName procedure was refusing to call nested lasses. To see what I mean, consider that if y
....Read More |
Rating
|
|
|
Get the handle of the edit portion of a ComboBox
|
Total Hit (3007) |
The ComboBox control contains an invisible Edit window, which is used for the edit area. In most cases you don't need to access this inner control directly, but occasionally a direct control of that window can be useful. The first thing to do is get the handle of such inner Edit control, which you d
....Read More |
Rating
|
|
|
Add a file to the list of recent documents
|
Total Hit (3013) |
To add a file to the "Recents" folder, you just need a single API function: SHAddToRecentDocs. This function takes two parameters. The first is SHARD_PATH if you want to refer to the file with its path string, while is SHARD_PIDL if you use its identifier. The second is the path string of the file,
....Read More |
Rating
|
|
|
Simplify and optimize expressions with And, Or and Xor operators
|
Total Hit (3307) |
Let's assume you must test whether the most significan bit of an integer value is set or not. This is the code that you usually write:
' two cases, depending on whether the value is Integer or Long
If intValue And &H8000 Then
' most significant bit is set
End If
If lngValue And &H8000000
....Read More |
Rating
|
|
|
Redirect command line output to textbox using CreatePipe API
|
Total Hit (16715) |
This example illustrates a Visual Basic application starting another process with the purpose of redirecting that process's standard IO handles. The Visual Basic application redirects the created process's standard output handle to an anonymous pipe, then proceeds to read the output through the pipe
....Read More |
Rating
|
|
|
|
|
Developing Client-Server Applications with MS Winsock Control
|
Total Hit (2297) |
In this article, I am going to show how to use the Winsock in a client server environment, we will create two separate applications, one of which will be a server and the other will be a client. Both client and server will interact with each other to exchange data. Client will send a request to the
....Read More |
Rating
|
|
|
XPath Visualizer:A visual tool to test your XPath Statements
|
Total Hit (1536) |
XPath Visualiser is a tool that enables you to test your XPath queries.
This is a full blown Visual XPath Interpreter for the evaluation of any XPath expression and visual presentation of the resulting nodeset or scalar value.
«b»Screenshots:«/b»
«a href="http://www.vbxml.com/xpathvisualizer
....Read More |
Rating
|
|
|
HOWTO: Use the Chart Web Component with Visual Basic
|
Total Hit (2552) |
This article shows the different ways that you can access the documentation for Microsoft Office Web Components (OWC). The article also includes information about additional resources for programming the OWC.
|
Rating
|
|
|
Detecting ListView SubItem Clicks in Normal And FullRowSelect Mode
|
Total Hit (1151) |
This page demonstrates using the LVHITTESTINFO type along with the LVM_SUBITEMHITTEST message to determine where on the control the mouse was clicked, regardless of the view mode or whether the FullRowSelect feature has been enabled (Label1). The code is provided in the MouseDown event to both take
....Read More |
Rating
|
|
|
System Internet Connection - Determining How and If Connected
|
Total Hit (2557) |
If you are designing a project which can use an Internet connection, it can be useful to know whether the system is connected or not. There are various methods of doing this, however the most informative and reliable method is to use the WinInet.DLL InternetGetConnectedStateEx API call. The only pro
....Read More |
Rating
|
|
|
|
vbAccelerator Accelerator Control
|
Total Hit (815) |
If you've ever tried to pick a keyboard accelerator for the menu items Back and Next in your application, you might have discovered a limitation in VB's ability to set up accelerators. IE offers some sensibly chosen keyboard accelerators for its Back, Next, Home shortcuts, using Alt and the arrow an
....Read More |
Rating
|
|
|
Icons without forms and document association icons in VB
|
Total Hit (1963) |
VB allows you to choose an icon for an executable, but it offers a somewhat limited choice. The icon must be stored in a form included in your VB project, and you can only pick one icon to be exposed publicly per project. Whilst the single icon is the most important one, you might want to have addit
....Read More |
Rating
|
|