How can I tell if a WindowsForms10.BUTTON.... is a checkbox or radiobutton

A

Aberro-Bill

I am spying on another process and I can tell that the window I am looking
at is a WindowsForms10.BUTTON.... but I don't see how to tell if this is a
regular button, checkbox or radiobutton. I looked at the window style but
this does not seem to use the styles BS_RADIOBUTTON, BS_CHECKBOX, etc. I
need to similarly differentiate controls that show up as
WindowsForms10.Window... such as picture box, group box
Thanks,
Bill
 
M

Mattias Sjögren

I looked at the window style but
this does not seem to use the styles BS_RADIOBUTTON, BS_CHECKBOX, etc.

Did you use a tool such as Spy++ to check the window styles or some
other way? The BS_ bit flags should be set, but Spy++ will not
recognize them as such when the window class name isn't "Button". So
you have to look at the numeric value and not just the name.


Mattias
 
A

Aberro-Bill

Hi Mattias,

Yes, I used Spy++

Style Word results for .NET 2 controls using Spy++
Control StyleWord
Button 0x56012F00
Checkbox 0x56012D25 or 0x56012D05 or 0x5601000B or 0x5601022B
Radiobutton 0x56012D04 or 0x5601000B

Notice that both Checkbox and RadioButton can return a style word of
0x5601000B - so the style word can't be used to tell the type

I rechecked many times on different apps to make sure I am not making
errors.

Thanks,
Bill
 
J

Jeffrey Tan[MSFT]

Hi Bill,

Thanks for your post!

For managed .Net winform application, in order to get more detailed
information of the controls, you may give the following "managed Spy++" a
look:
"Managed Spy--Deliver The Power Of Spy++ To Windows Forms With Our New Tool"
http://msdn.microsoft.com/msdnmag/issues/06/04/ManagedSpy/

This tool is developed by one of the .Net winform developer. This article
has the tool source code followed with it.

Hope this helps!

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 

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