I'm trying to track down why some of my dynamically created child controls in a Windows dialog are out of order when it comes to navigating the开发者_如何学Pythonm with the tab key. In the absence of anything else fiddling with them, the order should be defined by the order in which they are added into the dialog, but one specific type of child control is consistently being sorted last.
I know that one way to re-order them is using SetWindowPos()
, using the hWndInsertAfter
parameter and without setting the SWP_NOZORDER
flag. I am fairly sure I've eliminated this as the possible cause of this re-ordering.
So, for further leads into this as well as just for future reference, apart from SetWindowPos()
, what other win32 calls can re-order existing child controls in a dialog?
That's pretty much it - in a standard dialog, the tab order is just the z order, except that you can control where to start in the z order. If you've got a couple of controls that always end up at the end of your tab order, something is manipulating the z order to put them there.
If the dialog or controls are non-standard, the tab order may be manipulated directly by the WndProc. This is generally a bad idea, but has been known to happen from time to time.
精彩评论