Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Bug in the logic?
Message
De
27/09/2011 16:34:59
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01524938
Message ID:
01524979
Vues:
83
This message has been marked as a message which has helped to the initial question of the thread.
>Hi everybody,
>
>I have a pageframe with many pages. In one page I want to set lbl caption in run-time and after that center that label. In Page.Activate I put this code
>
>LOCAL loError as Exception 
>try
>   this.lblPageInfo.caption = 'Component Shows for ' + thisform.oCurrentNode.Values('SeriesDescription').value
>   this.lblPageInfo.Visible = this.lblPageInfo.Visible  
>CATCH TO loError
>   *
>endtry
>this.lblPageInfo.Left = (this.Parent.Width - this.lblPageInfo.Width)/2  
>
>Label AutoSize property is set to true.
>
>However, the label does not get centered.
>
>What do I miss?
>
>Thanks in advance.
>
>BTW, I think I need to drop the word 'Component' from that text.


For better result, I will use this.Parent.PageWidth instead of this.Parent.Width
And will put additional code in PageFrame.Resize
*!* PageFrame.Resize, will always center when PageFrame resized
this.PageX.lblPageInfo.Left = (this.PageWidth - this.PageX.lblPageInfo.Width) / 2

*!* PageFrame.PageX.Active
this.lblPageInfo.caption = 'Component Shows for ' + thisform.oCurrentNode.Values('SeriesDescription').value
this.lblPageInfo.Left = (this.Parent.PageWidth - this.lblPageInfo.Width) / 2
Regards,
Ony
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform