I'm using the ssTab control (that's probably my entire problem) in a VB6 program, and I'm plotting data into a Picturebox located on Tab 0. When I redraw the graph (after a window resize, for example), the first thing I do is clear the box:
Picture2.Line (0, 0)-(Picture2.Width, Picture2.Height), RGB(255, 255, 255), BF
That works fine when Tab 0 is visible, but if this code is called when a different tab is visible, the background for the entire visible tab (as well as tab 0) gets painted white. Not just the area of Picture2, but the entire visible area of both tabs. Tabs besides 0 and the currently selected tab are not affected.
My first attempt to crudely fix this was adding changing the tab back to tab 0 immediately before the above Line command:
SSTab1.Tab = 0 ' Select tab containing PictureBox2
DoEvents
but that gets the same results - both the original and 0 tabs are now white (although it does change the visible tab back to tab 0).
I noticed that when the wallpainting occurs, the value of Picture2.Width is way larger than it should be. If Tab 0 is visible, Picture2.Width varies between 7180 and 21225 Twips as I resize the window. When I select Tab 1 and resize, Picture2.Width is on the order of 82180 (the height stays where it should be).
I know the SStab is a bit buggy, but does anyone know any workaraounds? I can probably kludge together a fix (repaint background on both tabs gray after a redraw), but I'd like to understand why Picture2.Width loses its mind...