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
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
steve
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.
What to display something at the lines centre
steve
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
steve
I have tried that code, but it display the label at one end of the line and not the centre.
steve
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.
Thanks for your reply. that piece of code works wonders.
Thanks
steve
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.