Sign in to follow this  
Followers 0
Bob Coleman

Setting (checking) or clearing (unchecking) check box

11 posts in this topic

I know that in a dialog box, the spacebar will toggle a check box on (checked) or off (unchecked). I seem to recall that there is some key combination that will unconditionally check or uncheck the box, but I can neither recall nor find this key combination at the moment. Can someone refresh my memory?

Share this post


Link to post
Share on other sites



If your wanting to set the hotkey in your program, you could probrably just use HotKeySet() and change the state. Otherwise, the closest I came was pressing tab until its highlighted, then space to change it

Share this post


Link to post
Share on other sites

Might be able to accomplish this if the check box as a letter that's underlined. Then you could send an Alt-Y for example to answer Yes to a message box. Hope this helps.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I know that in a dialog box, the spacebar will toggle a check box on (checked) or off (unchecked). I seem to recall that there is some key combination that will unconditionally check or uncheck the box, but I can neither recall nor find this key combination at the moment. Can someone refresh my memory?

"Numeric Keyboard +" to select and "Numeric Keyboard -" to deselect ... :whistle:

Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

"Numeric Keyboard +" to select and "Numeric Keyboard -" to deselect ... :whistle:

I thought it had something to do with "numeric pad +" and "numeric pad -", but I can't get it to work (with the physical keys, let alone with Autoit). I guess I'll have to try to figure out if I have something else running that's interfering.

Share this post


Link to post
Share on other sites

The most reliable way to do this is by using the ControlCommand Function. Read here for more information

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Yes, I know that ControlCommand Function is the "best" way, but the dialog box (presented by Firefox) that brought up the original question doesn't have the individual check boxes as controls that can be recognized by Autoit. At least this appears to be the case based on information presented by the Info Tool.

Edited by Bob Coleman

Share this post


Link to post
Share on other sites

I started my system in safe mode. Still the Spacebar toggles the check boxes, but the "+" and "-" keys have no effect. For now, this has become a matter of academic curiosity for me and I have no idea why this might be true, but could XP Service Pack 2 or some other patch have disabled the relevant functions of the "+" and "-" keys?

Share this post


Link to post
Share on other sites

@Bob: Are the checkboxes contained in a TreeView control? That would explain why the individual checkboxes don't show up in Auto Window Info.


Auto3Lib: A library of over 1200 functions for AutoIt

Share this post


Link to post
Share on other sites

@Bob: Are the checkboxes contained in a TreeView control? That would explain why the individual checkboxes don't show up in Auto Window Info.

I'm getting into something I don't really understand, but, for illustration, I just clicked the Start button, right-clicked My Computer, and clicked Properties. From the resulting System Properties, I clicked Advanced and then under Performance, Settings. This results in several radio buttons and a scrollable list of check boxes. Each radio button seems to be a separate control whereas the list of check boxes seems to be one control with a ClassnameNN of SysTreeView321. I assume these are "contained in a TreeView control" and I think your point is that they could not be manipulated with ControlCommand.

It is also the case, that any of these check boxes can be toggled on and off with the Spacebar, but the numeric pad "+" and "-" do nothing.

Where I originally encountered this "problem" is in Firefox 2.0 RC3 after selecting Tools -> Options -> Privacy -> Clear Now (under Private Data). This results in a Clear Private Data dialog containing several check boxes for categories of data to clear. However, these boxes are not in a scrollable list. The entire area of the dialog outside the area containing the check boxes (and captions) is "MozillaWindowClass1". This area includes a couple of buttons which don't seem to be recognizable controls. The entire area encompassing the check boxes and their captions is "MozillaWindowClass2", so I'm guessing the boxes are not "contained in a TreeView control".

I've discovered other reasons that I don't think I can do what I was originally trying to do with Autoit and Firefox, so now I'm just curious about the non-functioning of the pad plus and minus keys on any check boxes.

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

For the Performance settings, the checkboxes that you are describing are contained in a TreeView control. Currently, AutoIt does not have native support for this control. However, Auto3Lib has full support for TreeViews and in fact, there is a demo script that shows how to manipulate the Performance settings.

The fact that the checkboxes are actually part of a TreeView control also answers your question as to why the numeric +/- don't work.

As for FireFox, I'm afraid that I can't help you there.

Edited by PaulIA

Auto3Lib: A library of over 1200 functions for AutoIt

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0