Disappearing (ok) button when showing a form modally with ShowDialog()

J

Jon Pawley

Hi.

I have what seems to be an intermittant problem with the (ok) button
disappearing from forms when I show them modally using ShowDialog(). I
am struggling to understand a) why this happens, and b) how to stop
this happening.

I have a cached collection of forms that I instantiate once at app
startup, and then, whenever I want to show a form, I go to the cached
collection, and show the form required modally. The user will then
interact with the form, and then close it again, using the (ok)
button.

So, in the Forms Designer, I have set the MinimizeBox to false, and
the ControlBox to true. I have also assigned a menu to each form. I
have also assigned an event handler for the Activate event on each
form, so that it loads its data as needed. (In the Deactivated event
handler, I save the data back to the DB.)

As I said, it's intermittant. The form gets shown OK the first time
around, with the (ok) button present. If I close the form, and then go
back into it, sometimes the (ok) button just disappears. This then
means that the user has no way of closing the form.

It all seems odd to me, and infuriating too.

Does anyone have any suggestions?

Many thanks,

Jon
 
T

Tim Wilson [MVP]

Yes, you should upgrade to SP2. Here's a bug ("defect") fix straight from
the list posted with the service pack:
"OK button eventually goes away when re-using recycled form for
ShowDialog()"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top