Mysteriously Vanishing OK Button?

  • Thread starter Thread starter Brad Evan
  • Start date Start date
any other workarounds?
the problem is on a dialog that i am reusing.... [has lots of textboxes]
the code is a bit like this.. [c#]

the form has a member variable of xyzdialog, which is set to new xyzdialog()
during program startup.

on menu item click, the stub function calls globalxyzdialog.ShowDialog().


i added this.panel1.bringtofront() and this.bringtofront() to the on-load
event of xyzdialog....but [consistently] if i enter the dialog and then
close it 5 times, on the 5th time, the OK button is gone.
[prior to adding the bringtofront commands, it happened on the 3rd time]

xyzdialog shouldn't be getting gc'd....there is a reference[pointer] to it
(the member of the main form)
.....
*sigh*
 
Ok. In that case you are in the same boat as I am. Your setup is very
similar to mine and currently I do not believe there is a workaround.


Brad Evan said:
any other workarounds?
the problem is on a dialog that i am reusing.... [has lots of textboxes]
the code is a bit like this.. [c#]

the form has a member variable of xyzdialog, which is set to new xyzdialog()
during program startup.

on menu item click, the stub function calls globalxyzdialog.ShowDialog().


i added this.panel1.bringtofront() and this.bringtofront() to the on-load
event of xyzdialog....but [consistently] if i enter the dialog and then
close it 5 times, on the 5th time, the OK button is gone.
[prior to adding the bringtofront commands, it happened on the 3rd time]

xyzdialog shouldn't be getting gc'd....there is a reference[pointer] to it
(the member of the main form)
....
*sigh*

Alex Feinman said:
Yes. It's a known issue. While this is being investigated, in many cases
calling BringToFront on parent form after the modal form is dimissed helps.
 
Possible work around -- add :
this.ControlBox=false;
this.ControlBox=true;


to the on_load event handler......

[equivalents in vb.net, etc? anyone?]

I stress tested it -- before the dialog would lose its ok box after 5-10
open/"OK"s.....where now, it doesnt seem to vanish, even after 100. [yeah,
I sat and clicked the damn thing 100 times]

However, it takes an _obscene_ amount of time to load now...[although not as
bad as the original]






Alex Feinman said:
Ok. In that case you are in the same boat as I am. Your setup is very
similar to mine and currently I do not believe there is a workaround.


Brad Evan said:
any other workarounds?
the problem is on a dialog that i am reusing.... [has lots of textboxes]
the code is a bit like this.. [c#]

the form has a member variable of xyzdialog, which is set to new xyzdialog()
during program startup.

on menu item click, the stub function calls globalxyzdialog.ShowDialog().


i added this.panel1.bringtofront() and this.bringtofront() to the on-load
event of xyzdialog....but [consistently] if i enter the dialog and then
close it 5 times, on the 5th time, the OK button is gone.
[prior to adding the bringtofront commands, it happened on the 3rd time]

xyzdialog shouldn't be getting gc'd....there is a reference[pointer] to it
(the member of the main form)
....
*sigh*

Alex Feinman said:
Yes. It's a known issue. While this is being investigated, in many cases
calling BringToFront on parent form after the modal form is dimissed helps.

anyone else experiencing this on dialogs?

-b
 
Back
Top