Handling a change in Height

  • Thread starter Thread starter Mark Irvine
  • Start date Start date
M

Mark Irvine

Hi,

I am dynamically adding a series of custom labels (inherieted from the
label) controls that respond to the click event. When this event fires the
height of the label is doubled to allow more data to be displayed. However
when I do this I was the rest of the controls to move down. How should I go
about this?

Mark
 
I am dynamically adding a series of custom labels (inherieted from the
label) controls that respond to the click event. When this event fires the
height of the label is doubled to allow more data to be displayed. However
when I do this I was the rest of the controls to move down. How should I go
about this?

Mark, AFAIK you have to move all the controls down yourself, there is no
automatic reformatting in Windows Forms.

Depending on how the controls are laid out on the form, you might be able
to just iterate the Controls collection and add a certain amount to the
'Top' property of every control that is below your label control... and
subtract it again when the label goes back to single height.

Cheers,

Richard.
 
Richard,

Many thanks for your prompt reply. After googling and not finding anything,
I was afraid that this was the case.

Mark
 
Back
Top