开发者

How to solve this TabStop style Issue

I know that using isDialogMessage() function we can able to switch the focus from one control to another. My doubt is 开发者_如何学运维

  • is it possible to override that the control should focus from first button to third button.
  • If possible how to customize WS_TABSTOP property

I also like to know that on what basis the focus is shifted from control to control.

How to set the tabindex property for each control?


The order for tab stop depends on the order in which the controls have been added on the dialog. You can open the dialog in the resource editor in Visual Studio and press CTRL+D to see and modify the tab order.

To modify just press on the number that appears in the top left of the control. The control with the number 1 will be the first control to have focus on your dialog, the order is given by consecutive numbers. Using this method you can set any tab order.

Hope this helps.


Determine which control after which you want to insert the new control in the tab order then use SetWindowPos like this:

SetWindowPos(hNewControl, hOldControl, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);

This changes the z-order of controls which, in turn, establishes the tab order.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜