Author |
Message |
campbel #1 / 10
|
Property sheets: Changing [tab] to [alt][tab]?
How do you change the default action of the [tab] key to [alt][tab] for property sheet tabs? Currently pressing [tab] moves first to the property sheet tab then to each data field then back to the property sheet tab. I want to limit the action of [tab] to moving between data fields within the active property sheet and use only [alt][tab] to access and move between property sheets. For some reason, the I've overlooked the logic of this probably simple task. Any thoughts? campbell
|
Fri, 07 Dec 2001 03:00:00 GMT |
|
|
David Lownd #2 / 10
|
Property sheets: Changing [tab] to [alt][tab]?
Quote: >Currently pressing [tab] moves first to the property sheet tab then to each >data field then back to the property sheet tab. >I want to limit the action of [tab] to moving between data fields within the >active property sheet and use only [alt][tab] to access and move between >property sheets. For some reason, the I've overlooked the logic of this >probably simple task.
campbell, I've not tried this, but I think you're probably looking for TCS_FOCUSNEVER. Access the tab control (GetTabControl) during your property sheet's OnInitDialog and set this style flag. BTW, it's Ctrl+Tab (or Ctrl+Page Up/Down) rather than Alt+Tab. Dave ---- My address is altered to discourage junk mail. Please post responses to the newsgroup thread, there's no need for follow-up email copies.
|
Fri, 07 Dec 2001 03:00:00 GMT |
|
|
Brian Wra #3 / 10
|
Property sheets: Changing [tab] to [alt][tab]?
Quote:
> >Currently pressing [tab] moves first to the property sheet tab then to each > >data field then back to the property sheet tab. > >I want to limit the action of [tab] to moving between data fields within the > >active property sheet and use only [alt][tab] to access and move between > >property sheets. For some reason, the I've overlooked the logic of this > >probably simple task. > campbell, > I've not tried this, but I think you're probably looking for > TCS_FOCUSNEVER. > Access the tab control (GetTabControl) during your property sheet's > OnInitDialog and set this style flag. > BTW, it's Ctrl+Tab (or Ctrl+Page Up/Down) rather than Alt+Tab.
Campbell, TCS_FOCUSNEVER is a Tab Control Style: look it up under CTabCtrl::Create. Unfortunately it doesn't work in the way you want! The Tab Control is created automatically by the Property Sheet with the WS_TABSTOP style, so in your Property Sheet's OnInitDialog method you need to add the following: GetTabControl()->ModifyStyle( WS_TABSTOP, 0 ); Obviously it would be cleaner if you added a member CTabCtrl and subclassed the dialog item to allow you better control over it! Cheers, Brian. Sent via Deja.com http://www.deja.com/ Share what you know. Learn what you don't.
|
Sun, 09 Dec 2001 03:00:00 GMT |
|
|
#4 / 10
|
Property sheets: Changing [tab] to [alt][tab]?
|
Fri, 19 Jun 1992 00:00:00 GMT |
|
|
David Lownd #5 / 10
|
Property sheets: Changing [tab] to [alt][tab]?
Quote: >Thanks, David, for your thoughts. I am unable to find TCS_FOCUSNEVER within >CPROPERTYSHEET class.
campbell, It's a style of the tab control, not the property sheet. Use GetTabControl from CPropertySheet::OnInitDialog, and then use ModifyStyle on the tab control window. Quote: >I want the [Tab] key to work only within the active sheet, but to not >highlight the propertysheet tab [Slider Range]. So, pressing the [Tab] key >should to move only between Minimum and Maximum value data fields and the >[OK] and [Cancel] buttons, but should not highlight [Slider Range]. There >should be no change in the default behavior of pressing [Ctrl][Tab].
That's what I'm hoping that style will do. Dave ---- My address is altered to discourage junk mail. Please post responses to the newsgroup thread, there's no need for follow-up email copies.
|
Sun, 09 Dec 2001 03:00:00 GMT |
|
|
campbel #6 / 10
|
Property sheets: Changing [tab] to [alt][tab]?
David and Brian: GetTabControl()->ModifyStyle( WS_ TABSTOP, 0 ) disabled the [Tab] key, leaving [Ctrl][Tab] default behavior intact... just what we wanted. Haven't played with the TCS_FOCUSNEVER flag, yet. I'll let you know. Many thanks, again. campbell Quote:
>>Thanks, David, for your thoughts. I am unable to find TCS_FOCUSNEVER within >>CPROPERTYSHEET class. >campbell, >It's a style of the tab control, not the property sheet. Use >GetTabControl from CPropertySheet::OnInitDialog, and then use >ModifyStyle on the tab control window. >>I want the [Tab] key to work only within the active sheet, but to not >>highlight the propertysheet tab [Slider Range]. So, pressing the [Tab] key >>should to move only between Minimum and Maximum value data fields and the >>[OK] and [Cancel] buttons, but should not highlight [Slider Range]. There >>should be no change in the default behavior of pressing [Ctrl][Tab]. >That's what I'm hoping that style will do. >Dave
|
Mon, 10 Dec 2001 03:00:00 GMT |
|
|
David Lownd #7 / 10
|
Property sheets: Changing [tab] to [alt][tab]?
Quote: >GetTabControl()->ModifyStyle( WS_ TABSTOP, 0 ) disabled the [Tab] key,
Does that prevent you setting focus on the tab by using the mouse though? Dave ---- My address is altered to discourage junk mail. Please post responses to the newsgroup thread, there's no need for follow-up email copies.
|
Tue, 11 Dec 2001 03:00:00 GMT |
|
|
campbel #8 / 10
|
Property sheets: Changing [tab] to [alt][tab]?
>> GetTabControl()->ModifyStyle( WS_ TABSTOP, 0 ) >> disabled the [Tab] key, > Does that prevent you setting focus on the tab by using > the mouse though? Dave: ModifyStyle(..., 0) seems to only block the default behavior of pressing the [Tab] key for the propertysheet pages. [Ctrl][Tab] and the mouse still change focus of the propertysheet tabs. No change in [Tab] behavior within the propertysheet page. campbell
|
Wed, 12 Dec 2001 03:00:00 GMT |
|
|
David Lownd #9 / 10
|
Property sheets: Changing [tab] to [alt][tab]?
Quote: >ModifyStyle(..., 0) seems to only block the default behavior of pressing the >[Tab] key for the propertysheet pages.
I've decided to try this for myself. As I expected, removal of the WS_TABSTOP style only stops the normal TAB key operation, you can still click on the tab and it will get focus. On the other hand, adding the TCS_FOCUSNEVER style only stops the mouse click from setting focus on the tab control - the keyboard can still tab to the tab control. Therefore you need to use both - remove WS_TABSTOP, and set TCS_FOCUSNEVER: pTab->ModifyStyle( WS_TABSTOP, TCS_FOCUSNEVER ); Dave ---- My address is altered to discourage junk mail. Please post responses to the newsgroup thread, there's no need for follow-up email copies.
|
Wed, 12 Dec 2001 03:00:00 GMT |
|
|
campbel #10 / 10
|
Property sheets: Changing [tab] to [alt][tab]?
Yes. Good information. Thanks. campbell Quote:
>>ModifyStyle(..., 0) seems to only block the default behavior of pressing the >>[Tab] key for the propertysheet pages. >I've decided to try this for myself. >As I expected, removal of the WS_TABSTOP style only stops the normal >TAB key operation, you can still click on the tab and it will get >focus. >On the other hand, adding the TCS_FOCUSNEVER style only stops the >mouse click from setting focus on the tab control - the keyboard can >still tab to the tab control. >Therefore you need to use both - remove WS_TABSTOP, and set >TCS_FOCUSNEVER: > pTab->ModifyStyle( WS_TABSTOP, TCS_FOCUSNEVER ); >Dave >---- >My address is altered to discourage junk mail. >Please post responses to the newsgroup thread, >there's no need for follow-up email copies.
|
Thu, 13 Dec 2001 03:00:00 GMT |
|
|