Thanks for your suggestions, guys. None of them seemed to work, but thanks.
Fiddling with the z-order made no change whatsoever.
I tried putting all of my existing Panels into a 3-row tableLayoutPanel, and
not only did the flow not work right, the designer was kind enough to snip
all of my event handlers making the buttons useless.
I happened to stumble across something that did work in the end. I set the
Dock = Fill on the middle Panel *after* I hid the bottom Panel and executed
the Layout. For whatever mysterious reason, that seemed to produce the right
behavior.
It's been a long time since I worked with software as counter-intuitive,
self-destructive and productivity-inhibiting as the forms designer, I have to
say.
Thanks
Mark
Hi,
> I tried putting all of my existing Panels into a 3-row tableLayoutPanel, and
> not only did the flow not work right, the designer was kind enough to snip
> all of my event handlers making the buttons useless.
Cut and Paste actions will remove the Handles-clauses of your events, yes.
The code will remain there though.
> I happened to stumble across something that did work in the end. I set the
> Dock = Fill on the middle Panel *after* I hid the bottom Panel and executed
> the Layout. For whatever mysterious reason, that seemed to produce the right
> behavior.
I noticed that some parts of the docking and anchoring don't work as
expected too. A while back I wanted to save a form's location and size when
it was closed, so next time it opened it would appear just as it was back
then. I did that via property-binding. The result was that location and
size were right, but the anchoring didn't seem to fire. I.e., the controls'
weren't resized according to their anchor properties.
This was in a VS2005-solution and I never checked this with VS2008.
Also, I noticed that, if there is many columns and heavy usage of the
ColumnSpan and RowSpan properties, the TLP will not behave as expected.
> It's been a long time since I worked with software as counter-intuitive,
> self-destructive and productivity-inhibiting as the forms designer, I have to
> say.
Well, I must say that I very much appreciate the anchoring stuff and the
TLP. Back in the VB days I either coded resizing or used stuff like the
ComponentOne Sizer control. Both were a lot of work.
Re-reading your original posting, I guess that a) you don't need those 3
panels in general, it's rather the need for a couple of controls that might
have to be hidden. Thus, I'd only include those in a panel. If the panel
would then be placed in a TLP whose column/row is set to AutoSize, there is
a chance that sizing would work. If not, I'd simply add/remove the controls
to the form when required.
Also, if the form's size "snaps back" while resizing, check the MiniumSize
and MaximumSize properties.
But whatever might be your problem, if you can't work around unexpected
behaviour using anchors nor a TLP, why not write some code to do the
resizing. The number of controls you mentioned certainly wouldn't make me
look into too many non-code things ...
Cheers,
Olaf