[Gambas-user] Drag and drop to TextArea
vuott at tutanota.com
vuott at tutanota.com
Thu Nov 2 04:23:14 CET 2023
« Can the mouse pointer be tracked across a form or a component such as a TextArea without the need to hold the left button down? »
"Perhaps" these codes might give you an idea.
At least one TextArea is expected to be present on the Form.
1)
[code]
Private Timer1 As Timer
Public Sub Form_Open()
With Timer1 = New Timer As "Timer1"
.Delay = 20
End With
End
Public Sub Timer1_Timer()
Me.Title = "X = " & CStr(Mouse.ScreenX - Me.X) &
" Y = " & CStr(Mouse.ScreenY - Me.Y)
End
Public Sub Form_Enter()
Timer1.Start
End
Public Sub Form_Leave()
Timer1.Stop
End
[/code]
- - - - - - - - - - -
2)
[code]
Public Sub Form_Open()
Me.Tracking = True
TextArea1.Tracking = True
End
Public Sub Form_MouseMove()
Me.Title = "X = " & CStr(Mouse.ScreenX - Me.X) &
" Y = " & CStr(Mouse.ScreenY - Me.Y)
End
Public Sub TextArea1_MouseMove()
Me.Title = "X = " & CStr(Mouse.ScreenX - Me.X) &
" Y = " & CStr(Mouse.ScreenY - Me.Y)
End
[/code]
2 nov 2023, 02:23 da sbungay at smartsonsite.com:
> Can the mouse pointer be tracked across a form or a component such as a TextArea without the need to hold the left button down?
>
> If yes, then can the mouse pointer be tracked while dragging data?
>
> I need to drag data from one control (a treeview node in this case) to a text area and insert that data into the text area at the point where the mouse cursor located over the text area when the data is dropped.
>
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20231102/436b7535/attachment-0001.htm>
More information about the User
mailing list