Code to React to Shift+Click on Label?

ersocia

Aleph Null
Local time
Today, 12:56
Joined
Aug 10, 2012
Messages
41
the database i'm working on at work involves a "switchboard" form that i've put together. i'm quite proud of the work i've done so far, so i've decided to add a small 'watermark' if you will in the bottom right corner of the switchboard form, and for kicks i want to insert a message box or something when that mark is Shift+Clicked.. the problem is i haven't touched VB in years, so i don't really remember how to do anything.

how do i go about watching said label for a Shift+Click event and then reacting to it? (for example's sake, let's call the label "lbl_Signature")

(if you couldn't tell, this isn't terribly important. just something i wanted to do :P)
 
Look into the MouseDown and MouseUp events.
i appreciate the suggestion, but i do already understand that it would involve either the MouseClick or whatever, or either of those two you mentioned.. however, my problem is more related to how to test for a user holding Shift while clicking the label.
 
That's why I mentioned looking into those events. There's a parameter called Shift and that's what you use.
 
i appreciate the suggestion, but i do already understand that it would involve either the MouseClick or whatever, or either of those two you mentioned.. however, my problem is more related to how to test for a user holding Shift while clicking the label.
Did you even look? In the MouseDown event, for example, it shows:

Private Sub LabelNameHere_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)

So, if you look there you have the possibilty to find out which button on the mouse was clicked (left, right, middle, or alternates) and if the Shift key was pressed, including Alt as well).

It is always good to go take a look when someone suggests something instead of just assuming, which I'm guessing is what you did since it was fairly easy for me to go look as well.
 
Did you even look?
...
It is always good to go take a look when someone suggests something instead of just assuming, which I'm guessing is what you did since it was fairly easy for me to go look as well.
first off, no need to be snarky.
secondly, yes i did look into those events, before i even posted this thread.
third, i looked into it again after the post, and finally figured it out.

i'm not completely inept. i posted the question because, as i said, i haven't touched VB in so long, i couldn't remember or figure out how to even start writing the code based solely off the description of those events. but since, instead of being given an example, i was simply told to basically keep doing what i was doing, i did just that and figured it out for myself.
 
first off, no need to be snarky.
Wasn't being "snarky." But if you want to say I was, no problem. Your answer didn't indicate that you had looked into those events so don't go calling me names and take a look back and see where I would have known what the hell you had done.

So, anyway, I will go ahead and add you to my ignore list so you won't need to get any more comments back from me as I won't see any of yours. (by the way, not a good idea to piss off a moderator so you have one down on your list and you can work on the others if you want.)
 
whether you see this or not, i'm posting it to clarify.

the problem is i haven't touched VB in years, so i don't really remember how to do anything.

i would think the above sentence would illustrate that i needed more help than simply "look into the MouseDown event", since it emphasizes the fact that i didn't even know how to start writing the code.

Wasn't being "snarky." But if you want to say I was, no problem.

it read to me as a quip, so that's how i took it.

so don't go calling me names

when did i call anybody any names at all? 'snarky' is an adjective describing how something was said or how it sounds. no name-calling here.

(by the way, not a good idea to piss off a moderator so you have one down on your list and you can work on the others if you want.)

oh no. i've pissed off a moderator by misreading what they wrote! heaven forbid i should feel belittled by someone with more experience in VBA than myself.

enjoy your power.
 
He definitely didn't see it ersocia ;)

So are you all sorted now?
 
yeah, i figured he wouldn't, but i wanted to put it out there because it was absurd to me that a forum moderator would react that way to a single post, let alone ignoring a member.

i would think that a moderator of a forum would need to keep all members off of their ignore list. you know, wanting/needing to see all comments so that they can, i don't know, moderate them?

anyway, yes, i've got it all figured out now and it's working like a charm.

thank you for your help. all i initially wanted was an example, so i'm sorry if i sounded ungrateful at all. i ended up having to look up like 5 different examples just to figure out how to go about writing the code that i would need.
 
Last edited:
Ignoring when it comes to providing help, but he will still be able to moderate all your threads. He's one of the top mods.

I was expecting you to come back with something like, "can I see an example of how to go about it", then I certainly would have been able to show you some code. But since you said you hadn't done any VB in some time, I thought that telling you where to look was sufficient and it will come to you once you saw it.

Glad you got it sorted.
 

Users who are viewing this thread

Back
Top Bottom