Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
LABEL color class
Message
De
02/11/2004 16:14:16
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00951785
Message ID:
00957321
Vues:
12
>I did a simple test form, with textbox like before
>Under the setcaption method, an error pops up this line:
> .Height = .&lc_Object..Height + 1
>"unrecognise phrade/keyword"

I get it. You fill the caption with an empty string, right ? If so, remove all the code in SetCaption method, then put this code:
Local ln_X, lc_Object, ln_Left, ln_Len

With This
   .BorderWidth = 0
   If empty( .FontName )
      .FontName = ThisForm.FontName
   endif

   If empty( .FontSize )
      .FontSize = ThisForm.FontSize
   endif

   ln_left = 1

   ln_Len = len( .Caption )
   If (ln_Len > 0)
      For ln_X = 1 to ln_Len
         lc_Object = 'lblName' + transform( ln_X )

         .NewObject( lc_Object, 'lblChar', 'ClsLabel', , ;
            substr(.Caption, ln_X, 1), .FontName, .FontSize, .FontBold )

         With .&lc_Object
            .Top = 1
            .Left = ln_Left
            .Visible = .T.
            ln_Left = ln_Left + .Width - 2
         EndWith
      Next

      .Width = ln_Left + 2
      .Height = .&lc_Object..Height + 1
   endif
EndWith
Herman
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform