CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    May 1999
    Posts
    2

    Changing Tab Order -Run Time

    How can I change the tab order of the controls dynamically created.

    Please reply fast.... Very urgent~!!!!!!!!!!!!!

    Girish Prabhu

  2. #2
    Join Date
    Apr 1999
    Posts
    27,449

    Re: Changing Tab Order -Run Time

    The tab-order is determined by the z-order of the window. You need to call SetWindowPos() on each child window to set the z-order.

    Regards,

    Paul McKenzie


  3. #3
    Join Date
    May 1999
    Posts
    2

    Re: Changing Tab Order -Run Time

    Thank you for your reply. I had already tested SetWindowPos(). It just changes the Window cordinates(Window position). No the tab order or Z-Order as in VB. I was able to solve this problem. What we have to do is disable the default tab function key. In IDR_MAINFRAME of accelerators, set ID_NEXT_FIELD or any ID with an accelerator VK_TAB and another for Shift+VK_TAB. Then map the functions for this. And you can write the code to find out the next Ctrl using your own logic in these funcrtions. So simple is it!!! But I took two working days for finding this out... Thanks agian for looking at my problem...
    Girish
    Nova Info Tech

    Girish Prabhu

  4. #4
    Join Date
    Apr 1999
    Posts
    27,449

    Re: Changing Tab Order -Run Time

    By definition, that's how tab order is set in a window -- according to the z-order of the child controls. I have used SetWindowPos() to set the tab order of controls many times. However, if you are talking about a dialog box, the tab order is set by the order of the controls in the dialog template.

    If you're not talking about a dialog, possibly you didn't use the SWP_xxxx flags correctly or the HWND parameter that specifies the window to insert after? I think that you didn't call it correctly since you stated that all it did was "change the Window coordinates". The coordinates can not change if SWP_NOMOVE and SWP_NOSIZE is specified.

    Regards,

    Paul McKenzie




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