Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a simple dialog box

Status
Not open for further replies.

rohbe

IS-IT--Management
Aug 30, 2001
76
US
I need a simple dialog box for displaying a field and containing a CANCEL button. The form that calls this dialog box contains all the routines that are being processed. The dialog box acts like a Thermometer but with the extra button. I would like the dialog box to remain in the foreground until the processing in the calling form is complete at which time the form releases

What is the easiest way to create this dialog box - is there a class already for this or do I create another form and make it modeless but then how do I keep it in the foreground

Thanks,
Jean
 
rohbe

Not sure exactly what you need. I guess it depends how :all the routines that are being processed. In order to determine how to stop the process, but you could start with this:
Code:
PUBLIC oform1

oform1=NEWOBJECT("form1")
oform1.Show
RETURN


	**************************************************
*-- Form:         form1 (c:\demo\form1.scx)
*-- ParentClass:  form
*-- BaseClass:    form
*-- Time Stamp:   07/31/02 04:54:05 PM
*
DEFINE CLASS form1 AS form


	Height = 82
	Width = 242
	DoCreate = .T.
	AutoCenter = .T.
	Caption = "Please wait"
	Closable = .F.
	MaxButton = .F.
	MinButton = .F.
	AlwaysOnTop = .T.
	Name = "form1"


	ADD OBJECT command1 AS commandbutton WITH ;
		Top = 36, ;
		Left = 72, ;
		Height = 27, ;
		Width = 84, ;
		Caption = "Cancel", ;
		Name = "Command1"


	PROCEDURE command1.Click
		thisform.Release()
	ENDPROC


ENDDEFINE
*
*-- EndDefine: form1
**************************************************



 
public formname, lloopcontrol
lloopcontrol = .t.
do form myform name formname to lloopcontrol

put your actions in a loop
do while lloopcontrol
... actions
enddo

in the unload event of the form
return .f.
in the click event of form
thisform.release

in the loop you can address the form objects like
formname.text1.value = 'my value'


Attitude is Everything
 
Danceman

Where would you put the lloopcontrol to .F. when you have an sql statement that take five minutes to generate?
 
danceman

That is why I said to Rohbe it depends how all the routines that are being processed
 
mgagnon

that why I
<do while lloopcontrol
... actions
<enddo
said actions, notice the plural on actions

if you are going to do one action then you don't need a cancel buton.

or was this a test. Attitude is Everything
 
Danceman

A test? no, but I think that (If you don't mind) if you and I have &quot;discussions&quot; over yours and my posts, that Rohbe (and anyone else reading this) might get more insight into the pitfalls and solutions, that they might not have thought off.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top