Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating AutoSize
Message
General information
Forum:
Visual Basic
Category:
ActiveX controls
Title:
Creating AutoSize
Miscellaneous
Thread ID:
00783006
Message ID:
00783006
Views:
47
I'm creating an ActiveX Control. I dropped a label onto a control and
set the AutoSize on the label to True.

Then I created a SetCaption method:
Public Sub SetCaption(sNewCaption As String)

  sCaption = sNewCaption
  lblLabel.Caption = sCaption

  UserControl.Width = lblLabel.Width + 100

End Sub
The problem is that unless I add the '+ 100' to the witdh, the
control ends up smaller than the label, and some of it is cropped
off.

Adding the 100 would be ok, if I was'nt using different fonts.
But since the font could be set to anything, how do I accuratly
calculate the width of the control??

Thanks
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Next
Reply
Map
View

Click here to load this message in the networking platform