Hi,
my problem is that I have a smal dialog whith some UltraLabel in a TabelLayoutPanel.
I want to set the UltraLabel to AutoSize = true but this resolves in a bad performance.
I added a Demo Version.
I this you have 3 Versions of my Dialog
1 whith UltraLabel.AutoSize = true and DockStyle= Fill
1 whith UltraLabel.AutoSize = false and DockStyle= Fill
1 whith UltraLabel.AutoSize = true and DockStyle= None
all the other things are the same (I only copyed the Dialog)
On the start Form you can open all this Dialogs and the Dialog (AutoSize = true and DockStyle= Fill) from a member so you see the constructor dose not cost much time.
If you try it you can see UltraLabel.AutoSize = false and DockStyle= Fill is much more performant than the other.
Any idea why this is so or a way to get AutoSize whithout losing performace?
Thanks
Wolfgang
Hello Wolfgang,
AutoSize means that control is automatically resized to display the entire content. DockStyle = Fill mean that control borders are docked to its parent control and determines how a control is resized within the parent. When you set AutoSize = true and DockSile = Fill, then control first calculate how should be the sized based of its content, resize itself , then control get resized again to fit its parent container, because of the DockStyle property.
Let me know if you have any further questions.
Hello,
I know what the meaning of the properties is.
My Problem is the bad performance if i set UltraLabel.AutoSize=true.
I want AutoSize cause the text showd fit in the control and DockStyle = Fill cause all the Labels in the same column showd be at the same size (for example so realise a better OnClick). The Colum is also AutoSize
If you have al look on my Example you can see that if I set AutoSize on true the Dialog need noticeable more time to be shown. No reason if DockStyle ist set or not.