flicker on resizing tabcontrols
-
I've been getting a weird flicker with my TabControl (.NET Windows Forms) when I try and use it in a dynamically resizable window. I can move the window around and it paints fine but resizing it looks pretty bad. Any ideas? Thx, Sieg
SYMPTOMS When making a call to TabPage.setSelectedTab() from within an OnSelectedIndexChanged event handler of the parent TabControl, the focus will first go to the user-selected index before returning to the index value set in the setSelectedTab() call. In addition, when returning to the index set in code by the setSelectedTab() call, the children components of the set TabPage will not be visible and Control.setVisible(true) must be used, causing a noticeable flicker. RESOLUTION To work around this problem, call Control.setVisible(true) on the TabPage after the setSelectedTab() call is made. Maybe on the resize event you need to again setVisible(true) to get the flicker to go away? Give it a whirl and see what happens... Practice sesquipedalianism! ;)