|
-
Aug 3rd, 2005, 04:47 AM
#1
Thread Starter
Hyperactive Member
[Resolved by krtxmrtz] MouseMove over right hand edge of textbox.
Hi,
I've an annoyance that perhaps you can help with ?
I want to know when the mouse is over the right hand edge of a control (nominally a text box). The left and width are pixels while value is in TWIPS (or vice-versa). Anyone got a suggestion ? I need to use the mousemove to change the mousepointer and to enable the user to stretch the textbox.
Thanks in advance.
Chubby..
Last edited by Chubby; Aug 3rd, 2005 at 05:33 AM.
-
Aug 3rd, 2005, 05:09 AM
#2
Re: MouseMove over right hand edge of textbox.
 Originally Posted by Chubby
Hi,
I've an annoyance that perhaps you can help with ?
I want to know when the mouse is over the right hand edge of a control (nominally a text box). The left and width are pixels while value is in TWIPS (or vice-versa). Anyone got a suggestion ? I need to use the mousemove to change the mousepointer and to enable the user to stretch the textbox.
Thanks in advance.
Chubby..
I have found this code for manually resizing it horizontally (place a textbox named Text1 in a form):
VB Code:
Dim EnableResizing As Boolean
Dim Tp As Single
Private Sub Form_Load()
EnableResizing = False
Tp = Text1.Top
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If MousePointer = 9 Then
EnableResizing = True
End If
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Y < Tp + Text1.Height And Y > Tp And (Abs(X - Text1.Left) < 120 Or Abs(X - Text1.Left - Text1.Width) < 120) Then
MousePointer = 9
Else
MousePointer = 0
End If
If EnableResizing Then
If Abs(X - Text1.Left) < 120 Then
Text1.Move X, Tp, Text1.Width - X + Text1.Left, Text1.Height
ElseIf Abs(X - Text1.Left - Text1.Width) < 120 Then
Text1.Move Text1.Left, Tp, X - Text1.Left, Text1.Height
End If
End If
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
EnableResizing = False
End Sub
Private Sub Text1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Y < Text1.Height And Y > 0 And (X < 120 Or Text1.Width - X < 120) Then
MousePointer = 9
Else
MousePointer = 0
End If
End Sub
Lottery is a tax on people who are bad at maths
If only mosquitoes sucked fat instead of blood...
To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)
-
Aug 3rd, 2005, 05:32 AM
#3
Thread Starter
Hyperactive Member
Re: MouseMove over right hand edge of textbox.
krtxmrtz,
Your time and effort is most appreciated. The code you posted up, found or-not works a treat and is exactly what I'm looking for.
Thanks very much.
Chubby..
-
Aug 3rd, 2005, 05:41 AM
#4
Re: MouseMove over right hand edge of textbox.
 Originally Posted by Chubby
krtxmrtz,
Your time and effort is most appreciated. The code you posted up, found or-not works a treat and is exactly what I'm looking for.
Thanks very much.
Chubby.. 
You're most welcome.
Fortunately I had already worked on this some time ago and all I had to do was pull it back from my data bank.
Lottery is a tax on people who are bad at maths
If only mosquitoes sucked fat instead of blood...
To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)
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
|