Link to home
Start Free TrialLog in
Avatar of amillyard
amillyardFlag for United Kingdom of Great Britain and Northern Ireland

asked on

closing winform

Can open a 2nd WinForm via the 1st main WinForm.

Created an association (ownership) between the 1st and newly opened 2nd WinForm

The scripting also checks to see if the WinForm has been opened already ... this works (appears too).

Issue is:  when closing the 2nd WinForm and then wanting to open it again I call the opening WinForm script again -- but I cannot reopen the WinForm (once closed) -- I suspect it has something to with the formBrowser  null  status.

How do I reset this parameter or get working correctly?
// WinForm #1
 
FormBrowser formBrowser;
 
 
if (formBrowser != null) return;
 
formBrowser = new FormBrowser { Owner = this };
formBrowser.Show();

Open in new window

Avatar of angus_young_acdc
angus_young_acdc
Flag of United Kingdom of Great Britain and Northern Ireland image

Have you put in a breakpoint to see if formBrowser is null?  
Avatar of amillyard

ASKER

angus_young_acdc:  checking the breakpoint ... null the 1st time called.  the 2nd onwards is not displayed as null, but is soft of empty !   when disposing the WinForm, it is not resetting back to null status
Avatar of VikramMullick
VikramMullick

try
formBrowser.Showdialog(this)
SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
carl_tawn: & emoreau:  works great now :-)   many thanks.