View previous topic :: View next topic |
Author |
Message |
jicman
Joined: 22 Dec 2004 Posts: 298 Location: Rochester, NY
|
Posted: Sat Jun 16, 2007 11:30 pm Post subject: How to find out if a form has been created |
|
|
Greetings!
I have been looking in the Form help site, but I have not been able to see anything that I could use. I have a form called "Form1" that is created when I click a button. When I click this button, this Form gets created again. I would like to know if that form has already been created so that I will not create it again.
Any help would be greatly appreciate it.
thanks,
jic |
|
Back to top |
|
|
cracki
Joined: 07 May 2007 Posts: 10 Location: Germany
|
Posted: Sun Jun 17, 2007 9:07 am Post subject: |
|
|
you need to keep a handle to it. _________________ ...meh... |
|
Back to top |
|
|
jicman
Joined: 22 Dec 2004 Posts: 298 Location: Rochester, NY
|
Posted: Sun Jun 17, 2007 6:39 pm Post subject: |
|
|
Thanks.
Ok, this works ok,
Code: |
protected void btnReport_click(Object sender, EventArgs ea)
{
NewReportForm();
}
final void NewReportForm()
{
if (!ReportForm)
{
with(ReportForm = new Form)
{
text = "Choose What Report To Create";
startPosition = dfl.form.FormStartPosition.CENTER_PARENT;
with (new Button)
{
text = "Combined";
location = Point(10, 10);
parent = ReportForm;
click ~= &CombinedReportClick;
}
show();
}
}
else
{
ReportForm.activate();
if (!ReportForm.activeForm())
{
ReportForm = null;
NewReportForm();
}
}
}
|
however, if I close the Form it will never come up. I guess I could create the form without a closing but I want to be able to do this. I am new to Windows and I could go and try all the thousands options available, but a little help will be better.
Any ideas?
jic |
|
Back to top |
|
|
Chris Miller
Joined: 27 Mar 2004 Posts: 514 Location: The Internet
|
Posted: Fri Jul 06, 2007 11:10 am Post subject: |
|
|
I would cancel the closing event (closing ea.cancel = true) and instead hide() the form. In your 'else' (the ReportForm was created) you could simply show() it. |
|
Back to top |
|
|
|