Button state

J

joe

Hi,

How can I query the state of a button (pressed or not)?
I could not find anything like that in MSDN.

Thanks
 
H

Herfried K. Wagner [MVP]

Hello,

joe said:
How can I query the state of a button (pressed or not)?
I could not find anything like that in MSDN.

You may want to use SendMessage (P/Invoke) + BM_GETSTATE.

HTH,
Herfried K. Wagner
 
J

joe

Well, yes, if there is something missing in .NET library,
just go for the good, old APIs. I actually had to derive
my own button from System.Windows.Form.Button for other
purposes, so adding a bool variable and trapping
MouseUp/Down events was not a big deal. I was just
surprised that I could not find such a basic property...

Thanks,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top