CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Join Date
    Oct 2019
    Posts
    82

    Changing tab order of buttons of Cpropertysheet

    I have changed the position of Buttons of Cpropertysheet but when i am pressing the tab key from keyboard the order of moving of control remains old one.Since we dont have any .rc file for Cpropertysheet so we cannot also change tab key pressing order from there by just moving particular component above in .rc file.So how can i change tab pressing order .

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Changing tab order of buttons of Cpropertysheet

    You should use SetWindowPos function.
    Victor Nijegorodov

  3. #3
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: Changing tab order of buttons of Cpropertysheet

    How did you change the order? It should follow the sequence you use when you call AddPage

  4. #4
    Join Date
    Oct 2019
    Posts
    82

    Re: Changing tab order of buttons of Cpropertysheet

    Confusion confusion...explaining it in a simple way..I have three buttons(Ok,Cancel,Help) on my propertysheet.Now by using MoveWindow() method i have changed(swapped) the position of Ok and Cancel but problem here arises that now when i press tab key from keyboard it select the button as it was selecting previously before swapping the positions of buttons..So how can i make it correct .

  5. #5
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Changing tab order of buttons of Cpropertysheet

    See my post#2.
    Victor Nijegorodov

  6. #6
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: Changing tab order of buttons of Cpropertysheet

    Quote Originally Posted by Beginner_MFC View Post
    Confusion confusion...explaining it in a simple way..I have three buttons(Ok,Cancel,Help) on my propertysheet.Now by using MoveWindow() method i have changed(swapped) the position of Ok and Cancel but problem here arises that now when i press tab key from keyboard it select the button as it was selecting previously before swapping the positions of buttons..So how can i make it correct .
    Victor is right. I misread the post.

  7. #7
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Changing tab order of buttons of Cpropertysheet

    Quote Originally Posted by GCDEF View Post
    Victor is right. I misread the post.
    ... however the OP seems just to ignore all my posts...
    Victor Nijegorodov

  8. #8
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Changing tab order of buttons of Cpropertysheet

    Quote Originally Posted by VictorN View Post
    ... however the OP seems just to ignore all my posts...
    The OP must be looking at the wrong z-order.

  9. #9
    Join Date
    Dec 2019
    Posts
    13

    Re: Changing tab order of buttons of Cpropertysheet

    Hi VictorN,

    I am currently moving forward with your approach ie to use SetWindowPos function.
    But i have a query in the same.

    The parameter uFlags has values which are all specific to be window resizing & positioning.

    Then how can we use values of uFlags for positioning of buttons??

  10. #10
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Changing tab order of buttons of Cpropertysheet

    Quote Originally Posted by prernagupta171995 View Post
    Hi VictorN,

    I am currently moving forward with your approach ie to use SetWindowPos function.
    But i have a query in the same.

    The parameter uFlags has values which are all specific to be window resizing & positioning.

    Then how can we use values of uFlags for positioning of buttons??
    Buttons are windows.

  11. #11
    Join Date
    Dec 2019
    Posts
    13

    Re: Changing tab order of buttons of Cpropertysheet

    Thanks for your response.
    I'm currently using
    but1 -> SetWindowPos (*this, 5,5,5,5,SWP_SHOWWINDOW )

    where but1 is a CButton

    Can you please help me with the correct parameters of this function?

  12. #12
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Changing tab order of buttons of Cpropertysheet

    Quote Originally Posted by prernagupta171995 View Post
    Thanks for your response.
    I'm currently using
    but1 -> SetWindowPos (*this, 5,5,5,5,SWP_SHOWWINDOW )

    where but1 is a CButton

    Can you please help me with the correct parameters of this function?
    1. What is this?
    2. Where in z-order (ie after which another button/control) do you want the place this but1
    3. Have you read the MSDN docs about SetWindowPos its using?
    Victor Nijegorodov

  13. #13
    Join Date
    Dec 2019
    Posts
    13

    Re: Changing tab order of buttons of Cpropertysheet

    Yes Victor I have read and it is implemented now.

  14. #14
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Changing tab order of buttons of Cpropertysheet

    Quote Originally Posted by prernagupta171995 View Post
    Yes Victor I have read and it is implemented now.
    I you mean the code you have already posted here then you implemented it wrong. And it won't ever compile!
    Well, if you are going to use the MFC CWnd::SetWindowPos method then read this.
    Victor Nijegorodov

  15. #15
    Join Date
    Dec 2019
    Posts
    13

    Re: Changing tab order of buttons of Cpropertysheet

    No I meant what I posted was wrong. I implemented the correct code and took your suggested reference

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured