Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Form class not staying active
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01080334
Message ID:
01080370
Vues:
18
Tracy
Thanks for responding, Look at this code, the form still disappears when it hits "endwith".
* Routine: cmdselect.click
local lcClass,lcMo,lcDate,lcDay,lcYr
store "" to lcClass,lcMo,lcDate,lcDay,lcYr

with ThisForm
   if .grdSignUp.LastRow # 0
	if !empty(curEmployees.ccity) and !empty(curEmployees.cbldg)
		lcDate = allt(curEmployees.classdate)
		lcClass = allt(curEmployees.classes)
		lcMo = substr(lcDate,1,at(" ",lcDate)-1)
		lcDay = substr(lcDate,at(",",lcDate)-2,2)
		lcYr = right(lcDate,4)
		* call attended object so filter can be set and reset
	   select attended,classes,ccity,cbldg,croom,cmonths,cdates,cyears ;
		from signup ;
		into cursor curAttended ;
		where classes=lcClass and cmonths=lcMo and cdates=lcDay and cyears=lcYr
	   oAttend = createobj('attended',lcClass,lcMo,lcDay,lcYr,alias())
	   deactivate window menuscr
	   oAttend.visible=.T.
 	   oAttend.show
	else
 	   Messagebox("Please select a valid class to update the Class Attendance",48,"Class has no City or Building association")
	endif
   else
	Messagebox("Please highlight a record to update the Class Attendance",48,"No Class Selected")
   endif
endwith
>I created a modal form with a single command button on it and made the command button backcolor an unusual color (so it would stand out). Then I saved the form as a class called 'TestFormClass'
>I then created another form visually and in the click of a command button on this form I put:
>
>
>SET CLASSLIB TO "testformclass.vcx"
>frmMyForm = CREATEOBJECT('TestFormClass')  && Create a Form from this class
>frmMyForm.windowstate = 0
>
>frmMyForm.AddObject('shpLine','Line')  && Add a Line control to the form
>frmMyForm.AddObject('cmdCmndBtn1','commandbutton')  && Up Cmnd button
>
>frmMyForm.shpLine.Visible = .T.  && Make Line control visible
>frmMyForm.left = 10
>frmMyForm.backcolor = this.backcolor
>frmMyForm.Caption = "Test 2nd Form"
>frmMyForm.shpLine.Top = 20  && Specify Line control row
>frmMyForm.shpLine.Left = 125  && Specify Line control column
>frmMyForm.cmdCmndBtn1.caption = "Dummy Button"
>frmMyForm.cmdCmndBtn1.Visible =.T.  && Up Command button visible
>
>frmMyform.visible = .T.
>frmMyForm.SHOW()  && Display the form
>
>It works for me.
Extreme Programming = Plan -> Design -> Code -> Test
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform