Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: barney guna
  Where is barney guna?
 BANALORE
 India
 barney guna
 To: Vilhelm-Ion Praisach
  Where is Vilhelm-Ion Praisach?
 Resita
 Romania
 Vilhelm-Ion Praisach
 Tags
Subject: RE: how to clear a form or combox texbox
Thread ID: 394346 Message ID: 395675 # Views: 28 # Ratings: 0
Version: Visual FoxPro 6 Category: General VFP Topics
Date: Friday, January 17, 2014 5:27:15 AM         
   


> >
> >
> >
> > Dear Sir,
> > Sorry about that...
> > Actually I have a form in which I am entering some data using combo boxes and textboxes, after I click save I want to enter a new set of data,
> > for which I am going to the first combobox on top of the form, but all the data of the first record is still seen. I want to clear the data
> > as soom as setfocus to the first(top) combo box. Hope its clear now a bit more
> > Regs
> > Barney
>
> I understand you don't use ControlSource. One posibility:
>
>
PUBLIC oFrm
> oFrm=CREATEOBJECT("MyForm")
> oFrm.show()
> 
> DEFINE CLASS MyForm as Form
> 	saved=.T.
> 	keypreview=.T.
> 	ADD OBJECT cmb1 as mycombobox
> 	ADD OBJECT cmb2 as mycombobox WITH left=200,columncount=2
> 	ADD OBJECT txt1 as textboxn WITH top=50
> 	ADD OBJECT txt2 as textboxc WITH top=50,left=100
> 	ADD OBJECT txt3 as textboxd WITH top=50,left=200
> 	ADD OBJECT cmdS as commandbutton WITH top=100
> 	PROCEDURE keypress
> 		LPARAMETERS nKey,nShift
> 		IF nKey>=32
> 			This.saved=.F.
> 		ENDIF
> 	ENDPROC
> 	PROCEDURE init
> 		This.cmb1.additem("First")
> 		This.cmb1.additem("Second")
> 		This.cmb2.additem("Item")
> 		This.cmb2.List[This.cmb2.NewIndex,2]="First"
> 		This.cmb2.additem("Item")
> 		This.cmb2.List[This.cmb2.NewIndex,2]="Second"
> 		This.cmb2.BoundColumn=2
> 	ENDPROC
> 	PROCEDURE cmb1.gotfocus
> 		IF ThisForm.saved
> 			ThisForm.SetAll("Value",0,"textboxn")
> 			ThisForm.SetAll("Value",'',"textboxc")
> 			ThisForm.SetAll("Value",{},"textboxd")
> *			ThisForm.SetAll("DisplayValue","","mycombobox")
> 			ThisForm.SetAll("Value","","mycombobox")
> 		ENDIF
> 	ENDPROC
> 	PROCEDURE cmdS.click
> 		****************
> 		* Save procedure
> 		****************
> 		ThisForm.saved=.T.
> 	ENDPROC
> ENDDEFINE
> DEFINE CLASS textboxn as TextBox
> 	Value=0
> ENDDEFINE
> DEFINE CLASS textboxc as TextBox
> 	Value=''
> ENDDEFINE
> DEFINE CLASS textboxd as TextBox
> 	Value={}
> ENDDEFINE
> DEFINE CLASS mycombobox as ComboBox
> 	PROCEDURE interactivechange
> 		ThisForm.saved=.F.
> 	ENDPROC
> ENDDEFINE

>
>
> My respects

Thank you !!!!

ENTIRE THREAD

how to clear a form or combox texbox Posted by barney guna @ 1/2/2014 9:45:49 AM
RE: how to clear a form or combox texbox Posted by David Mustakim @ 1/2/2014 9:48:57 AM
RE: how to clear a form or combox texbox Posted by barney guna @ 1/2/2014 12:06:23 PM
RE: how to clear a form or combox texbox Posted by David Mustakim @ 1/2/2014 12:15:45 PM
RE: how to clear a form or combox texbox Posted by Vilhelm-Ion Praisach @ 1/2/2014 2:49:15 PM
RE: how to clear a form or combox texbox Posted by barney guna @ 1/17/2014 5:27:15 AM
RE: how to clear a form or combox texbox Posted by Jun Tangunan @ 1/3/2014 12:13:40 AM
RE: how to clear a form or combox texbox Posted by David Mustakim @ 1/3/2014 12:28:20 AM
RE: how to clear a form or combox texbox Posted by Tony Vignone @ 1/4/2014 5:53:56 PM
RE: how to clear a form or combox texbox Posted by barney guna @ 1/17/2014 5:28:36 AM
RE: how to clear a form or combox texbox Posted by jacob lefore @ 1/2/2014 4:15:30 PM
RE: how to clear a form or combox texbox Posted by Cetin Basoz @ 1/2/2014 4:51:25 PM
RE: how to clear a form or combox texbox Posted by Koen Piller @ 1/2/2014 5:03:44 PM
RE: how to clear a form or combox texbox Posted by Cetin Basoz @ 1/2/2014 6:31:46 PM
RE: how to clear a form or combox texbox Posted by Tony Vignone @ 1/4/2014 6:06:20 PM
RE: how to clear a form or combox texbox Posted by barney guna @ 1/17/2014 5:31:50 AM
RE: how to clear a form or combox texbox Posted by Cetin Basoz @ 1/17/2014 2:03:13 PM