Property 'FlowBreak' accessible only at design mode ?

P

philip

The FlowLayoutPanel is useful for HTML-like layout.
But there is an important problem.

1.
IN DESIGN MODE, all is normal.
If you insert a Label control on a form, the FlowBreak proprety doe's not
appear in property window of the Label. It's normal.
If you drag this control on a FlowLayoutPanel (in design mode), the
FlowBreak property appears in the property window of the Label control.
That is very good

BUT

2.
IN PROGRAMMATION MODE, something is wrong :
If I create dynamically my Label controls on the flowLayoutPanel using
something like :

Dim LabelControl as new Label
Me.FlowLayoutPanel1.Controls.Add (LabelControl)

then I CANNOT ACCESS to the FlowBreak property of the control. That is very
sad for the dynamic layout of this panel...

But someone can give me a solution ? It's important for me.

Thanks by advance
 
C

Chris Dunaway

The FlowBreak property is not provided by the Label it is provided by
the FlowLayoutPanel. If you look in the designer generated code for
the label, you will see the code necessary to set this value. It looks
like this:

Me.flowLayoutPanel1.SetFlowBreak(Me.label1, True)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top