|
-
Apr 19th, 2002, 01:41 PM
#1
Thread Starter
Frenzied Member
Line Control Problem
Hello
I have many line controls on my form. I want to display a value in the middle of the line control. So when the user moves the line control at run - time, the value will always stay in the centre of the line.
Many thanks in advance
-
Apr 19th, 2002, 01:46 PM
#2
Not NoteMe
Do you mean you want to display something at the centre of a line, or move the line's centre to where the user clicks??
Quotes:
"I am getting better then you guys.." NoteMe, on his leet english skills.
"And I am going to meat her again later on tonight." NoteMe
"I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
"my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
Have I helped you? Please Rate my posts. 
-
Apr 19th, 2002, 01:51 PM
#3
Thread Starter
Frenzied Member
What to display something at the lines centre
-
Apr 19th, 2002, 01:52 PM
#4
Thread Starter
Frenzied Member
Code:
Dim YPos As Single
Dim XPos As Single
With Line1
XPos = .X2 - X1
YPos = .Y2 - Y1
End With
With Label1
.Left = XPos
.Top = YPos
End With
-
Apr 19th, 2002, 01:53 PM
#5
Thread Starter
Frenzied Member
I have tried that code, but it display the label at one end of the line and not the centre.
-
Apr 19th, 2002, 01:53 PM
#6
Not NoteMe
VB Code:
Label1.left = Line.X1 + ((Line1.X2 - Line1.X1)/2) - (Label1.Width/2)
Label1.top = Line.Y1 + ((Line1.Y2 - Line1.Y1)/2)
Call that whenever the line moves.
EDIT: Changed for your objects, and made it place the label properly in the middle.
Last edited by SLH; Apr 19th, 2002 at 01:59 PM.
Quotes:
"I am getting better then you guys.." NoteMe, on his leet english skills.
"And I am going to meat her again later on tonight." NoteMe
"I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
"my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
Have I helped you? Please Rate my posts. 
-
Apr 19th, 2002, 01:57 PM
#7
Thread Starter
Frenzied Member
Thanks for your reply. that piece of code works wonders.
Thanks
-
Apr 19th, 2002, 01:59 PM
#8
Not NoteMe
Glad i could help
Quotes:
"I am getting better then you guys.." NoteMe, on his leet english skills.
"And I am going to meat her again later on tonight." NoteMe
"I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
"my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
Have I helped you? Please Rate my posts. 
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
|