|
-
Jan 22nd, 2003, 02:01 PM
#1
Thread Starter
New Member
select checkbox with mouse drag
dear friends,
i want to select checkboxes from the form on which the mouse is
drag over.
there are near about 40 check boxes.
one more need is there i can select all chekbox with mouse drag,
but it is possible when shift key is pressed .
how can this possible?????confused:
-
Jan 22nd, 2003, 02:14 PM
#2
Lively Member
If your trying to select the checkboxes when THEY are hovered over do this:
VB Code:
Private Sub Check1_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
'MsgBox Shift
If Check1(Index).Value = 0 And Shift = 0 Then
Check1(Index).Value = 1
ElseIf Check1(Index).Value = 1 And Shift = 1 Then
Check1(Index).Value = 0
End If
End Sub
Otherwise if you want them highlighted when the Form is hovered over then:
VB Code:
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
For X = 0 To 3
If Check1(x).Value = 0 And Shift = 0 Then
Check1(x).Value = 1
End If
Next X
End Sub
All this is easier if the checkboxes are in a control array
Hope this helps!
Dave
[vbcode]
Dim ScrewingAround as cIncessant.Need
Set ScrewingAround = New cIncessant.Need
If atWork = True then
Call ScrewingAround.begin
Else
Call ScrewingAround.begin 
End If
[/vbcode]
-
Jan 22nd, 2003, 02:18 PM
#3
Frenzied Member
I don't know if I understand your question.
If you want to be able to select a checkbox by moving the mouse over it (when the Shift key is held down), then this code should work:
VB Code:
Private Sub Check1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
' If shift is held down when mouse passes over, then select the checkbox
If Shift And vbShiftMask Then
Check1.Value = vbChecked
End If
End Sub
Or, are you actually DRAGGING over (as in drag and drop)?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|