Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to set color of buttons
Message
 
À
10/06/2004 22:15:09
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00912527
Message ID:
00912599
Vues:
15
This might do it for you.

use the Activex called Microsoft Forms2.0 commandbutton that ships with VFP, which has a background color property (If you are using it visually or programmatically, you cannot change the property on the Activex itself but the property need to be changed in the init of the form) . Here is an example how to use it, copy the following in a program and run it to see how it works:
Public oform1
oform1=createobject("form1")
oform1.AddObject("cmdbutton","cmdbutton")
oform1.Show
Return
Define Class form1 As Form
    DoCreate = .T.
    Caption = "Form1"
    Name = "Form1"
Enddefine
Define Class cmdButton As OleControl
    Procedure Init
       With This
        .Object.BackColor = 255
        .Caption = "Click me!"
       Endwith
      Endproc
OleClass = "forms.commandbutton.1"
Visible = .T.
Height =40
Top = 50
Left = 50
AutoSize = .T.
    Procedure Click
          Messagebox("This is a red button")
      Endproc
Enddefine
>Dear foxpro experts:
>
>
> I have a very simply question, how to set colors in a button. Thanks for giving me information about that.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform