When the user resizes their form, this triggers for form resize event which I trap and then use the ratio of old size to new size to give me new figures for height, left, top etc for each control.
I then iterate through the controls collection applying the new figures. This is fine for those controls shown on the visible tabs. However, the controls on the hidden tabs are moved away from their tab over to the left most side of the form.
On examination, the controls on the hidden tabs are given large negative values for their "Left" property and this produces the unwanted result.
Does anyone know of a way to effect a resize on all a forms controls when some are placed on a hidden tab?
p.s. Sorry about the post spread over a few mini-posts but for some reason I couldn't post this at one time!
I don't understand why you have to resize controls that are hidden, by the way--if they're hidden, why do we care what size they are?. Also, you may want to have a look at Golom's excellent thread222-1295329, which is a class to handle resizing.
simonkue, try putting all controls in a tab group on frames (you can also set the frames border style to 0-None). Then only the frame's position gets set to a minus value and not the controls on it.
BobRodes,
The controls are "hidden" because the relevant tab that they are on is not shown at the point of the resize. After resizing, I should be able to go to that tab and see the relevant controls resized. However, they are gone! Irrespective of the tab that is shown when I resize, those controls resize correctly. All those not shown (for which I use the term "hidden") are not positioned correctly after the resize.
SBerthold, the tab controls are already inside frames. However, the controls on each tab are not within frames. I will try this to see if it makes a difference.
All I'm saying is that you can always set up a routine that respecifies the dimensions of the controls once you show them again, can't you? And with SB's suggestion, all you'd have to do is one? Not sure about this, hence question marks.
If they remain hidden, then Bob is right. If you make them visible depending on a user's selection (w/o reloading), then I would in most cases make them always visible but set the Enabled property to False.
I always use a Frame on a SSTab's Tab to hold all controls. It does prevent some other bugs from happening as well (at least in the past)...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.