[Solved] Objects on Click..
Hello Everyone :wave:
look, for example I have 2 command buttons and a textbox, I want to make the Text property of Textbox is the NAME OF THE CONTROL TOOL where mouse pointer is on it. for example mouse pointer is above Command1, the Text property of Text1 will be"Command1"
Thanks for all who helped me and who tried to help :)
Re: [Vb6] Objects on Click..
You wanna be a bit more specific as to WHY you want this?
If, for example, you have this:
Code:
Private Sub Command1_Click()
MsgBox Command1.Name
End Sub
It returns, OF COURSE, "Command1"
Same with a TextBox (don't know what a textbook is other than what I used in college decades (many) ago.)
If you have an ARRAY of command buttons or textboxes, and you want to know which one was clicked, you'd refer to its index as well as its name.
So, what are you really looking for, and why?
Re: [Vb6] Objects on Click..
Sorrry it is TextBox (but the keyboard has changed the word to textbook)
I am not looking for know things I know already, I will explain :
I have 3 Objects: Command, TextBox and Slider for example. I want to know what user clicks, in other words, I need to get the name of the object which the user click.... Do you know how?
Re: [Vb6] Objects on Click..
What are the names of each of your three objects?
Re: [Vb6] Objects on Click..
How do you want to 'save' the information (the controls' names)? Why? Is this a homework assignment?
Re: [Vb6] Objects on Click..
Quote:
Originally Posted by
SamOscarBrown
How do you want to 'save' the information (the controls' names)? Why? Is this a homework assignment?
The names of them are: Command1, TextBox1, slider1 :|
It is not homework, I want to improve my projects, I want to control everything the user do.. Can you?
Re: [Vb6] Objects on Click..
Eng27,
You're being very vague. Sam basically told you how to do it in post#2. You want to "control everything the user do"? You need to be a lot more specific than that. What do you mean "control" it? You want to prevent it from happening? Hmmm, well, I can give you a procedure to do a global keyboard and mouse lock, but I don't think that's what you mean at all.
You must be clear with your specifications before we can help you.
Good Luck,
Elroy
Re: [Vb6] Objects on Click..
Quote:
Originally Posted by
Elroy
Eng27,
You're being very vague. Sam basically told you how to do it in post#2. You want to "control everything the user do"? You need to be a lot more specific than that. What do you mean "control" it? You want to prevent it from happening? Hmmm, well, I can give you a procedure to do a global keyboard and mouse lock, but I don't think that's what you mean at all.
You must be clear with your specifications before we can help you.
Good Luck,
Elroy
oh, I am not good in English so that I always fail in explaining :(
anyhow
I will explain again and change the example
(if I fail again in explaining what I need just don't reply :( )
look, for example I have 2 command buttons and a textbox
I want to make the Text property of Textbox is the NAME OF THE CONTROL TOOL where mouse pointer is on it.
for example mouse pointer is above Command1, the Text property of Text1 will be "Command1"
get it?!
1 Attachment(s)
Re: [Vb6] Objects on Click..
Hmm, it sounds a bit like you want the SPY project that's been floating around for years. I've heavily modified mine, and I'm not sure where to get a copy of the original, but I've attached a copy of the one I use.
You can certainly use that program to get the control name of anything you're hovering over.
Good Luck,
Elroy
1 Attachment(s)
Re: [Vb6] Objects on Click..
Quote:
Originally Posted by
Eng27
oh, I am not good in English so that I always fail in explaining :(
anyhow
I will explain again and change the example
(if I fail again in explaining what I need just don't reply :( )
look, for example I have 2 command buttons and a textbox
I want to make the Text property of Textbox is the NAME OF THE CONTROL TOOL where mouse pointer is on it.
for example mouse pointer is above Command1, the Text property of Text1 will be "Command1"
get it?!
That's different from your original requirement, but it's easier.
Nevertheless, it uses some API's.
See the project attached.
Re: [Vb6] Objects on Click..
Quote:
Originally Posted by
Elroy
Hmm, it sounds a bit like you want the SPY project that's been floating around for years. I've heavily modified mine, and I'm not sure where to get a copy of the original, but I've attached a copy of the one I use.
You can certainly use that program to get the control name of anything you're hovering over.
Good Luck,
Elroy
Tnx a lot Elroy
Re: [Vb6] Objects on Click..
Quote:
Originally Posted by
Eduardo-
That's different from your original requirement, but it's easier.
Nevertheless, it uses some API's.
See the project attached.
Oh sorry about my bad explaining
and thank you for the file, it will be very useful