tab bug in .NET?

closet geek

Newcomer
Joined
Apr 2, 2006
Messages
21
I have a strange issue which I can't track down, I'm starting to think it could be a bug in J#.

I have an app with a RichTextBox that displays the contents of a text file a user opens. Once the user opens one file they have the option to open another in a new tab (with another RTB on it). The issue appears to be with the:

tabControl1.set_SelectedTab();

method. If I specify that once that second tabPage is created that it should be "selected" using the above code the contents in the RichTextBox on that new tabPage gets scrolled to the bottom... If I don't select the new tab as it is created but manually click on the tab instead the contents of the RichTextBox doesn't scroll to the bottom.

Any ideas?
 
I've not tested it but my theory is this is caused by some sort of focus issue. By manually changing the selected tab (i.e. clicking on it) focus is maintained by the actually tab. Perhaps programmatically selecting the tab is setting focus to the first object on the tab page.
 
It seems to be something like that, I've had a go at forcing other things to have focus before the tab gets removed but it's not working well... I do think you're right however, but it looks like a work around is needed.
 
Back
Top