What are some tips that every VB programmer should know?
What IS an API call?
Where do I go for more VB help?
What is the difference between VBA and VB?
How do I copyright my programs?
How do I create a "floating toolbar" form?
How do I show an elapsed time greater than 24 hours?
How do I check if a MaskedEditBox control is empty?
How do I select or invert All items in a multi-select ListBox?
Where can I buy old versions of Microsoft Basic?
How do I pick a random number between 3 and 6?
How do I activate a previous instance when my program is run twice?
How do I convert between decimal, hex, and binary?
How do I specify a start-up path for VB?
How do I code a recursive power-of routine?
What is the formula for determining a leap year?
Where can I download VB?
Can I save images as JPEG?
How do I limit the text entry length in a ComboBox?
How do I send email with VB?
How do I retrieve the serial # on a peer to peer network volume?
How can I get a dialog box with "Yes", "Yes to All", and "No"?
How do I fix "Object Server" errors when using control custom properties?
How do I get the MAC address if I know the IP address?
How do I evaluate a math string?
How do I drag a PictureBox around?
How do I launch a Control Panel applet?
How do I rank search results?
How do I upload files to an ASP page using VBScript?
How do I restrict mouse movement to one area of my Form?
How do I show ToolTipText on each ListBox item?
How do I center a ListView item?
How do I edit Office document properties?
How do I emulate a ComboBox in HTML?
How do I know to use ByVal, ByRef, or As Any in API functions?
How do I determine what operating system is running?
How do I connect to another computer via the Internet for a chat app?
How do I store multiple files in a single file?
Where can I find documentation on Windows API calls?
How do I make my program run when Windows starts?
How do I show the "Open With" dialog?
How do I add Chat to my website?
How do I reference a UserControl from its subclassing module?
How do I get started with C++?
Perl search script used on BlackBeltVB.com
For questions not found on this FAQ:
Sign up for Yahoo eGroups and post on the BlackBeltVB group.

You can view and search the messages from the Yahoo eGroups BlackBeltVB forum.

What are some tips that every VB programmer should know?
What IS an API call?
Where do I go for more VB help?
What is the difference between VB and VBA?
How do I copyright my programs?
How do I create a "floating toolbar" form that stays on top in an MDI application?
How do I show an elapsed time greater than 24 hours?
How do I check if a MaskedEditBox control is empty?
How do I select All items in a multi-select ListBox? How do I invert the selection?
    Private Declare Function SendMessage Lib "user32" _
        Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, _
        ByVal wParam As Long, lParam As Any) As Long
    Const LB_SETSEL = &H185

    Private Sub cmdSelAll_Click()
        SendMessage List1.hwnd, LB_SETSEL, True, ByVal True
    End Sub

    Private Sub cmdInvert_Click()
        If List1.SelCount Then
            SendMessage List1.hwnd, LB_SETSEL, False, ByVal True
        Else
            cmdSelAll_Click
        End If
    End Sub

Where can I buy old versions of MS Basic?
How do I pick a random number between 3 and 6?
Randomize Timer
RandomNum = Int(Rnd * 4) + 3

How do I activate a previous instance when my program is run a second time?
' First, test for a previous instance:
If App.PrevInstance Then
    ' Then, save the application title:
    Dim aTitle As String
    aTitle = Me.Caption
    ' Change this app's title:
    Me.Caption = ""
    ' Activate the app with the title:
    AppActivate aTltle
End If
If the caption might not be unique or known, store the caption of the "running" instance in the Registry, retrieve it with the other instance and activate that:
If App.PrevInstance Then
    Me.Caption = ""
    AppActivate GetSetting("ProgramName","SectionName","Instance")
    End
Else
    SaveSetting "ProgramName", "SectionName", "Instance", Me.Caption
End If
Delete the registry setting when the program exits.
    DeleteSetting "ProgramName","SectionName","Instance"
Note that the End statement halts the program immediately, so the DeleteSetting command won't fire, even if you place it in the Unload event of a form that is loaded. Make sure you delete the registry setting before using the End statement.
How do I convert between decimal, hex, and binary?
Dim lDec As Long, aHex As String, aBin As String
lDec = 121
aHex = Hex$(lDec) ' Decimal to Hex
lDec = Val("&H" & aHex) ' Hex to Decimal
' Note that it is easier to convert Hex to Binary, so convert
' from Decimal to Hex first if you need to go from Decimal
' to Binary. The fastest Binary conversion is to use a
' "lookup table".
Dim vBinTable As Variant
vBinTable = Array("0000", "0001", "0010", "0011", _
                  "0100", "0101", "0110", "0111", _
                  "1000", "1001", "1010", "1011", _
                  "1100", "1101", "1110", "1111")
Dim i As Integer, k As Long
For k = 1 To Len(aHex)
   ' Hex to Binary
   i = Val("&H" & Mid$(aHex, k, 1))
   aBin = aBin & vBinTable(i)
Next
' It is also easier to convert from Binary to Decimal. However,
' it isn't always feasible - both Hex and Binary in VB can represent
' much larger values than Decimal. Thus, this conversion is from
' Binary to Hex, once again using a lookup table... of a different sort.
Dim aBinTable As String, aHexTable As String
aBinTable = " 0000 0001 0010 0011 0100 0101 0110 0111" & _
            " 1000 1001 1010 1011 1100 1101 1110 1111 "
aHexTable = "0123456789ABCDEF"
If Len(aBin) Mod 4 Then
     ' Make it an even length of 4
     aBin = String$(Len(aBin) Mod 4, "0") & aBin
End If
aHex = ""
For k = 1 To Len(aBin) Step 4
    i = InStr(aBinTable, " " & Mid$(aBin, k, 4))
    aHex = aHex & Mid$(aHexTable, (i - 1) \ 5 + 1, 1)
Next

How do I specify a start-up path for VB?
How do I code a recursive power-of routine?
What is the formula for determinig a leap year?
Where can I download VB?
Can I save images as JPEG?
How do I limit the text entry length in a ComboBox?
How do I send email with VB?
    Use the MAPI controls:

    With MAPISession1
        .LogonUI = True
        .UserName = "guest"
        .Password = "password"
        .SignOn
    End With
    With MAPIMessages1
        .SessionID = MAPISession1.SessionID
        .Compose
        .RecipDisplayName = "yourname@yourisp.com"

        .RecipAddress = "yourname@yourisp.com"

        .MsgSubject = "Test"
        .MsgNoteText = "Did it work?"
        .AddressResolveUI = True
        .ResolveName
        .Send False
    End With
    MAPISession1.SignOff

How do I retrieve the drive serial number on a peer to peer network volume?
How can I get a dialog box with "Yes", "Yes to All", and "No"?
How do I fix "Object Server" errors when using control custom properties?
How do I get the MAC address if I know the IP address?
How do I evaluate a math string?
How do I drag a PictureBox around?
How do I launch a Control Panel Applet?
How do I rank search results?
How do I upload files to an ASP page using VBScript?
How do I restrict mouse movement to one area of my Form?
How do I show ToolTipText on each ListBox item?
How do I center a ListView item?
How do I edit Office document properties?
How do I emulate a ComboBox in HTML
How do I know when to use ByVal, ByRef, As Any, etc... in API functions?
How do I determine what operating system is running?
How do I connect to another computer via the Internet for a chat application?
How do I store multiple files, such as an entire web site, in a single file?
Where can I find documentation on Windows API calls?
How do I make my program run when Windows starts?
How do I show the "Open With" dialog?
How do I add Chat to my website?
How do I reference a UserControl from its subclassing module?
How do I get started with C++?

Copyright © 2000 by Matt E. Hart, All Rights Reserved Worldwide.
Nothing on this web site may be reproduced, in any form, without express written consent.