Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Equal sign in label's .caption
Message
De
28/06/2005 13:04:51
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
28/06/2005 12:48:55
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01027099
Message ID:
01027125
Vues:
20
This message has been marked as a message which has helped to the initial question of the thread.
>>=" =" (Equal-apostoph-space-equal-apostroph"
>>
>>
>>>Can't get this to work... and can't find it in help either, and almost two years have passed since I last did this. UT search doesn't allow equal sign in the search string, and there don't seem to be too many label-related messages in this category anyway. So - question:
>>>
>>>I want to use a =expression as a caption of a label. But it doesn't refresh - whatever value the expression had when the label was instantiated, that value remains. I also tried =(expression), same result.
>>>
>>>Was there some trick to this?
>
>OK guys, you got me all wrong.
>
>1) I don't want to display an equal sign
>2) I know I can put any code into label's refresh - that's what I wanted to avoid
>3) I want to use the VFP's native behavior for cases when the .caption begins with an equal sign, but it evaluates the expression only once.
>
>How do I get it to re-evaluate the expression when the label refreshes? Without code, that is. I know I can write my own refresh - but then didn't need the special .caption format for that, I could have used a custom property to store the expression.

I don't know if there really is a special magical format for that. I needed to code at least in refresh:
Public oForm
oForm = Createobject('myForm')
oForm.Show()

Define Class myForm As Form

  Add Object myLabel As Label
  Add Object myTimer As Timer With Interval=1000

  Procedure Init
    Set Seconds On
    This.myLabel.Caption = "=ttoc(DATETIME())"
  Endproc

  Procedure myTimer.Timer
    Thisform.Refresh()
  Endproc

  Procedure Refresh
    With This.myLabel
      .Caption = .ReadExpression('Caption')
    Endwith
  Endproc
Enddefine
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform