Jump to content
  • Advertisement
Sign in to follow this  
Tac-Tics

[.net] Focus and scrollbars

This topic is 4948 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm having two questions about .NET Windowing. First, I have a TabControl with no tabs. The user selects an item from the main menu to open a tab. I can add the tab correctly and it works fine, but how do I force the newly created TabPage to acquire focus? Second, if I have a multiline TextBox with vertical scrollbars, how do I control the scrolling from within my program? In particular, when I add a new line to the textbox, how do I scroll down so the new text is displayed?

Share this post


Link to post
Share on other sites
Advertisement
1)You should be able to set the SelectedTab property to bring the tab to the front than call Focus() on it to give it focus or even call Focus on one of the components in the tab.

2)There is a method ScrollToCaret() on TextBox that may do what you want.

hope this helps.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!