|
-
Apr 1st, 2005, 04:40 AM
#1
Thread Starter
Hyperactive Member
Locating An Object
Does anybody know how to locate a control by its coordinates.
For Example, i have a label1, a label2, and a command button. When i click the command button i want the text of label 2 to have the name of the control(label1) at a certain point on the form.
If anyone understands what i'm trying to say, can you help me?
Unity Programs™ - Downloads To Make Your Computer Life Easier - UnityPrograms.com, check it out
My small company, I need feedback.
If someone's post was useful, don't forget to Rate It by clicking the Rate This Post link under the avatar.
If this post has been resolved. Please mark it as Resolved by going through the Thread Tools above and clicking on the Mark Thread Resolved option.
We ride together, We die together, .NET for life. - Working With Visual Studio.NET 2005
Application Deployment, General Developer Forum, Visual Basic .NET
-
Apr 1st, 2005, 07:22 AM
#2
Hyperactive Member
Re: Locating An Object
i can't clearly understand of your problem.
For Example, i have a label1, a label2, and a command button. When i click the command button i want the text of label 2 to have the name of the control(label1)
you mean that if you click the command button the value text in the label2 will come from the value of label1?
at a certain point on the form.
what particular coordinates? from label1 or label2?
please discuss it very well so that others might help you.
cheers.
-
Apr 1st, 2005, 07:34 AM
#3
Re: Locating An Object
 Originally Posted by StreaksAthlete
Does anybody know how to locate a control by its coordinates.
For Example, i have a label1, a label2, and a command button. When i click the command button i want the text of label 2 to have the name of the control(label1) at a certain point on the form.
If anyone understands what i'm trying to say, can you help me? 
Loop through all the controls on the form and test whether the x,y point falls within the control's area.
Bear in mind that sometimes you'd get controls within controls (panels and groupboxes) and so you might get a few controls overlapping the coordinate in question.
I don't live here any more.
-
Apr 1st, 2005, 10:44 AM
#4
Thread Starter
Hyperactive Member
Re: Locating An Object
OK, I like the loop idea, but i'm new and i dont have a clue how to do that. Could you give me the code please.
Unity Programs™ - Downloads To Make Your Computer Life Easier - UnityPrograms.com, check it out
My small company, I need feedback.
If someone's post was useful, don't forget to Rate It by clicking the Rate This Post link under the avatar.
If this post has been resolved. Please mark it as Resolved by going through the Thread Tools above and clicking on the Mark Thread Resolved option.
We ride together, We die together, .NET for life. - Working With Visual Studio.NET 2005
Application Deployment, General Developer Forum, Visual Basic .NET
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
|