Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Stubborn Caption Placement !
Message
De
22/01/2016 17:07:00
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows 7
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01629113
Message ID:
01630122
Vues:
75
This message has been marked as a message which has helped to the initial question of the thread.
J'aime (1)
i assume field1 & field2 are labels objects and you use vfp9
then can use bindevent to solve your problem.run the code and have tests on3 buttons
label1 is autosize=.t.
i use the event "Move" with bindevent.
Publi yform
yform=Newobject("asup")
yform.Show
Read Events
Retu
*
Define Class asup As Form
    Top = 112
    Left = 104
    Height = 250
    Width = 707
    Caption = "Form1"
    Name = "Form1"

    Add Object label1 As Label With ;
        AutoSize = .T., ;
        Caption = "azerty", ;
        Height = 17, ;
        Left = 48, ;
        Top = 24, ;
        Width = 33, ;
        Name = "Label1"

    Add Object label2 As Label With ;
        AutoSize = .F., ;
        FontSize = 12, ;
        Caption = "bzerty", ;
        Height = 21, ;
        Left = 101, ;
        Top = 24, ;
        Width = 43, ;
        ForeColor = Rgb(255,0,0), ;
        Name = "Label2"

    Add Object command1 As CommandButton With ;
        Top = 120, ;
        Left = 84, ;
        Height = 27, ;
        Width = 84, ;
        Caption = "Test1", ;
        Name = "Command1"

    Add Object command2 As CommandButton With ;
        Top = 154, ;
        Left = 85, ;
        Height = 27, ;
        Width = 84, ;
        Caption = "Test2", ;
        Name = "Command2"

    Add Object command3 As CommandButton With ;
        Top = 189, ;
        Left = 85, ;
        Height = 27, ;
        Width = 84, ;
        Caption = "Test3", ;
        Name = "Command3"

    Procedure my
        Lparameters nLeft, nTop, nWidth, nHeight
        Thisform.label2.Left = Thisform.label1.Left + Thisform.label1.Width + 20
    Endproc

    Procedure Init
        Thisform.label2.Left = Thisform.label1.Left + Thisform.label1.Width + 20
        Bindevent(Thisform.label1,"move",Thisform,"my")
    Endproc


    Procedure command1.Click
        Thisform.label1.Caption="ZRAREAEY  ezzezezez zezezzzez"
        Thisform.label1.Move(Thisform.label1.Left)
    Endproc


    Procedure command2.Click
        Thisform.label1.Caption="ZRAREAEY "

        Thisform.label1.Move(Thisform.label1.Left)
    Endproc

    Procedure command3.Click
        Thisform.label1.Caption="ZRAREAEY  ezzezezez zezezzzez ZRAREAEY  ezzezezez zezezzzez"
        Thisform.label1.Move(Thisform.label1.Left)
    Endproc

    Procedure Destroy
        Clea Events
    Endproc


Enddefine
*
*-- EndDefine: asup
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform