Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Create Search Variable field
Message
De
09/09/1998 20:16:38
Nancy Folsom
Pixel Dust Industries
Washington, États-Unis
 
 
À
09/09/1998 17:01:08
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00134811
Message ID:
00134854
Vues:
12
As Craig hints, this can get very complicated very fast. But, just for jollies, I thought it would be neat to make a little program that will, very simply, get some info from the user and return a value you could use to search on. You should be able to run the code.
PUBLIC obasic_form1

obasic_form1=CREATEOBJECT("basic_form1")
obasic_form1.Show
local ctext
ctext = obasic_form1.returntext  && a custom property the form has
RELEASE obasic_form1  && I just hid the modal form instead of releasing it, so I could get at the property that has my search string.
IF !ISNULL(ctext) && I return .NULL. if the user cancels
	=messagebox( "I want to search for " + ctext)  && just to confirm :-)
ELSE
	=Messagebox("no search today, thanks!")
ENDIF	
RETURN




* The following are the class.  You could also make your forms visually, of course.
**************************************************
*-- Form:         basic_form1 (d:\jobs\motorola\temp.scx)
*-- ParentClass:  form
*-- BaseClass:    form
*
DEFINE CLASS basic_form1 AS form


	Height = 106
	Width = 104
	DoCreate = .T.
	Caption = "Form1"
	WindowType = 1
	returntext = "''"
	Name = "Basic_form1"


	ADD OBJECT text1 AS textbox WITH ;
		Alignment = 3, ;
		Value = .NULL., ;
		ControlSource = "thisform.returntext", ;
		Height = 23, ;
		Left = 0, ;
		Top = 18, ;
		Width = 100, ;
		Name = "Text1"


	ADD OBJECT label1 AS label WITH ;
		Caption = "Enter your text:", ;
		Height = 17, ;
		Left = 0, ;
		Top = 0, ;
		Width = 100, ;
		Name = "Label1"


	ADD OBJECT command1 AS commandbutton WITH ;
		Top = 45, ;
		Left = 0, ;
		Height = 27, ;
		Width = 100, ;
		Caption = "Okay, go ahead...", ;
		Name = "Command1"


	ADD OBJECT command2 AS commandbutton WITH ;
		Top = 78, ;
		Left = 0, ;
		Height = 27, ;
		Width = 100, ;
		Caption = "Forget It!", ;
		Name = "Command2"


	PROCEDURE Unload
		this.hide
		RETURN this.returntext
	ENDPROC


	PROCEDURE command1.Click
		thisform.unload
	ENDPROC


	PROCEDURE command2.Click
		thisform.text1.value = .null.
		thisform.unload
	ENDPROC


ENDDEFINE
*
*-- EndDefine: basic_form1
**************************************************
>Hi
>
>I am new to FoxPro and getting my teeth into it. I need help please !!
>
>I am using a simple database indexed on last name and code. I have made a form with two pages. On the first page I have browse type screen and on the next page I have edit type screen. I have used command buttons to view, edit, go top, go bottom etc. I want to give my user an option for search. When the user click the search button, I would like an empty field to appear on the page where user can type in the few characters of code or name to search and click OK. I have read the books for days and I can not figure out how to create this small input screen to search...Can anyone help .. . . . .
>
>Your early reply will be appreciated.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform