Browsing Visual Basic 6
Flex-Print
Print a FlexGrid.
Span a picture on multiple pages
Print a big picture on four pages Private Sub cmdPrint_Click() Const PAGE_WIDTH = 8.
Drag a Control
Drag a control at runtimePrivate Declare Function ReleaseCapture Lib "user32" () As LongPrivate Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, _ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As LongConst WM_NCLBUTTONDOWN = &HA1Const HTCAPTION = 2Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Picture1.
Search and Highlight
Find a string in a textbox and highlightPrivate Function FindString (Control As Control, FindStr As String, Optional StartPos As Integer = 1 ) As Boolean Dim a As Integer a = InStr(StartPos, LCase$(Control.
Place a progress bar in a status bar panel
Place a status bar and a progress bar on a form and make the progress bar invisible.
Tabs in Listbox
Set tab stops in listboxPrivate Declare Function SendMessage Lib "USER32" Alias "SendMessageA" (ByVal hWnd As Long, _ByVal wMsg As Long, ByVal wParam As Long, lParam As Long) As LongPrivate Declare Function GetDialogBaseUnits Lib "USER32" () As LongConst LB_SETTABSTOPS = &H192Sub SetTabStops(lListWindowHandle As ListBox, iNoTabStops As Integer, lTabPositions() As Long) Dim iIndex As Integer Dim lDialogBaseUnits As Long Dim iDialogUnitsX As Integer lDialogBaseUnits = GetDialogBaseUnits() iDialogUnitsX = (lDialogBaseUnits And &HFFFF&) \ 4 ReDim lTabPos(0 To iNoTabStops - 1) As Long For iIndex = 0 To iNoTabStops - 1 lTabPos(iIndex) = lTabPositions(iIndex) * iDialogUnitsX * 2 Next iIndex Call SendMessage(lListWindowHandle.