That would help for the top level controls, but any labels inside other controls would be missed. The easiest way to change the default would be to create your own Label that inherits from the normal one and override (or shadow) the Autosize property. Then use that control instead of the built in Windows one.
Otherwise, you could do what the post says to do above, but you have to make a recursive function for it:
Code:In the form load: ... For Each labForm As Control In Me.Controls FixAutosize(labForm) Next ... Public Sub FixAutosize(ByVal control As Control) If labForm.GetType.Name = "Label" Then CType(labForm, Label).Autosize= true For Each cntl As Control In control.Controls FixAutosize(cntl) Next End Sub




Reply With Quote