Google

Rabu, 03 Oktober 2007

Custom Mouse Icon in VB6

  1. Create Add New Resource File in Menu Project.if you doesn’t see it, click Add-Ins then choice Add-In Manager. And you choice VB 6 Resource Editor, don’t forget if you want load this add-ins you must choice loaded/unload and load startup
  2. where you click Add New resource file, create name what you like and then click open, and there is a dialog form and u choice ok, id you want new create it
  3. there is 3 function add (cursor,bitmap,custom) , click add cursor and. Each cursor u add there is ID, ID can be change of name, if you close it you save it
  4. now, back a new form. Create a component which there is mouse icon procedure eg. Command button. First set mousepointer = custom 99
  5. write code form load

Command1.MouseIcon = LoadResPicture(101, 2)

And write code command button

Private Sub Command1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)

Command1.MouseIcon = LoadResPicture(102, 2)

End Sub

Private Sub Command1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)

Command1.MouseIcon = LoadResPicture(101, 2)

End Sub

  1. you can try use add bitmap or custom, custom I usualy for audio, why use resource editor?? Because where it compiled, you no need copy file resource (*.res), automaticly in exe

Use Mouse Scroll DataGrid in VB6

Create dim bCancel as boolean
set bCancel = cancel in DataGrid setfocus, changed true if lostfocus,including unload form

Private Sub Proses(ByVal DatGrid As DataGrid)
Dim Message As msg
Do While Not bCancel
If PeekMessage(Message, DatGrid.hWnd, WM_MOUSEWHEEL, WM_MOUSEWHEEL, PM_REMOVE) Then
If Message.wParam < 0 Then
DatGrid.Scroll 0, 1
' Me.Top = Me.Top + 240
Else
DatGrid.Scroll 0, -1
' Me.Top = Me.Top - 240
End If
End If
DoEvents
Loop
End Sub