Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creating AutoSize
Message
Information générale
Forum:
Visual Basic
Catégorie:
Contrôles ActiveX
Titre:
Creating AutoSize
Divers
Thread ID:
00783006
Message ID:
00783006
Vues:
48
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform