Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Command button programatically firing
Message
 
À
25/03/2002 15:03:41
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00636847
Message ID:
00636994
Vues:
14
>Timothy,
>
>You could do it within the init() method of the textbox, or you could do it from outside of the textBox:
>
>
frmMyForm.AddObject('text1','myTextBox')
>goodDate = date() && or do your restore here
>                  && I would consider retrieving goodDate from a table rather
>                  && rather than from a memory variable file...
>frmMyForm.text1.value = goodDate
>
>>
>>YES, that example helped alot, got me on track. 1 quest I have though is that I substituted a textbox for the cmdbuttons in the example and I want the textbox to start off with a value taken from a .mem var. Where do I put my "restore from l:gooddate.mem addit" statement to make it work? Right now it's telling me "GOODDATE" is not found.
>>
>>

That doesn't seem to work given the way this is designed let me include what I have(if not too long)

pForm=CREATEOBJECT("Form")
pForm.WindowType=1 && set modal to avoid using READ EVENTS for demo
pForm.Autocenter=.T.
pForm.Caption="Enter this month's (25th) Cc Date for techs to post"
pForm.Addobject("mtb","tbtextbox")
pForm.Addobject("mlab","tblabel")
rest from l:gooddate.mem addit
pForm.Width=550
pForm.Height=250
* pForm.mtb.value= gooddate
pform.show
pform.mtb.value=gooddate

DEFINE CLASS tbtextbox as textbox
Left = 10 && Command button column
Top = 20 && Command button row
Height = 45 && Command button height
Width=85
fontsize=16
forecolor=128
Visible=.t.
ENDDEFINE

PROCEDURE Click
* rest from l:gooddate.mem addit
* ThisForm.shpLine.Visible = .F. && Hide the Line control
* ThisForm.shpLine.LineSlant ='/' && Slant up
* ThisForm.shpLine.Visible = .T. && Show the Line control


ENDDEFINE



DEFINE CLASS tblabel as label
Width=550
Height=250
Top=80
Left=20
Width=450
caption="Enter Julian date (25th)"
height=25
fontsize=16
forecolor=128
Visible=.t.
ENDdefine

PROCEDURE Click
CLEAR EVENTS && Stop event processing, close Form
ENDDEFINE



rest from l:gooddate.mem addit


wait
*release thisform
*retu
"Build a man a fire, and he's warm for a day.
Set a man on fire, and he's warm for the rest of his life."
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform