简体   繁体   中英

Unable to set focus on ToolStrip button

I have tried to research this all morning and found no solution that worked for me.

I have a ToolStrip , with several buttons on it. I am unable to get figure out how to select any of the buttons when using tab . I did find that it would systematically select the toolstrip but showed no visual indication of that. I only found this out by hitting the left arrow key each time I hit tab.

So my question is, how can I get one button on the toolstrip(Button1) to be selected (so that when I would hit enter, it would automatically use the button) by hitting the tab button.

I have turned the TabStop = True and the TabStop on the main UC is also set to True. I have assigned the ToolStrip a final Index number also. But still nothing gets highlight, but it's focused. I want the Button1 to be focused when I focus the ToolStrip .

Thanks for your help in advance!

ToolStrip.Focus()

Button.Select()

You cant set focus to any button in toolStrip except first Button or any element. So dont try it. Its Waste of time...I already tried..that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM