Control Visiblity Issue-Is this a bug?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi guys.Consider the following situation:
There is a panel on a form whose visible property is set to false(I mean it
is invisible
when it is created.)
there is a button on this panel which when pressed,shows a modal
form(ShowDialog function).
if we set panel's visible property to "True" at run time,and then press the
button,the modal form is displayed,but when you close the modal form,an
exception is thrown with the following message:
"An error has occured in the application"-it says something like
"SEHException".
I'm becoming angry now,since I encounter many of these situations.Is it a
bug?and
if it is,do you have any solution?
 
When you say you are showing a modal window, using ShowDialog(), I assume you
mean the ShowDialog function of the CommonDialog class. If so, what dialog
window are you showing? Or, are you attempting to just lift up a modal form
of your own?

The reason I ask is there are different ways of handling a dialog box. The
Common Dialog's proper use is to expose a variety of "pickers", like the file
dialog, the color dialog, etc. If you are using this functionality for your
own modal dialog boxes, you are likely to be using the ShowDialog()
incorrectly.

I would also post the exact error message, as it might help someone
determine precisely what is going wrong.


---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 
Well,any form in the .net world inherits the ShowDialog function,isn't it?
I have a form of my own,and I try to show it to the user,and ask him to
click one of
the buttons and return a result.No matter how I try it,(in the above
mentioned case)
it always throws that exception and forces me to end the application.
This exception is thrown on the line which has started the application,like
Sub Main:
Application.Run(frmMain)
 
I thought it is better to tell you exactly how I show my form:
dim frm as new frmSomeForm
If frm.ShowDialog()=DialogResult.OK then
'OK was pressed,apply settings...
end if
frm.Dispose
 
Back
Top