Public Function CBin(ByVal Nr As Long, Optional Precision As Integer = As String
Do Until Nr = 0
CBin = CStr((Nr Mod 2)) + CBin
Nr = Nr 2
Loop
CBin = Format(Val(CBin), String(Precision, “0″))
End Function
Private Sub Form_Load()
MsgBox CBin(88)
End Sub
Bookmark It
Function SetBytes(Bytes) As String
On Error GoTo errorhandler
If Bytes >= 1073741824 Then
SetBytes = Format(Bytes / 1024 / 1024 / 1024, “#0.00″) _
& ” GB”
ElseIf Bytes >= 1048576 Then
SetBytes = Format(Bytes / 1024 / 1024, “#0.00″) & ” MB”
ElseIf Bytes [...]
Place a combo box on a form and enter the following code.
Private Sub Form_Load()
Dim printer
For Each printer In Printers
Combo1.AddItem printer.DeviceName
Next
End Sub
Bookmark It
Declare Function SystemParametersInfo Lib “user32″ Alias “SystemParametersInfoA” (ByVal uAction As Long, ByVal uParam As Long, ByVal lpvParam As Any, ByVal fuWinIni As Long) As Long
Public Const SPI_SETDESKWALLPAPER = 20
Dim lngSuccess As Long
Dim strBitmapImage As String
strBitmapImage = “h:windowsstraw.bmp”
lngSuccess = SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, strBitmapImage, 0)
Bookmark It
Private Declare Function SetVolumeLabelA Lib “kernel32″ _
(ByVal lpRootPathName As String, _
ByVal lpVolumeName As String) As Long
Public Function SetVolumeName(sDrive As String, n As String) As Boolean
Dim i As Long
i = SetVolumeLabelA(sDrive + “:” & Chr$(0), n & Chr$(0))
SetVolumeName = IIf(i = [...]