Sign in to follow this  

[.net] Focus and scrollbars

This topic is 4731 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
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

This topic is 4731 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this