473,394 Members | 1,797 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Modal Form not closign cleanly

Hi All,

I think I'm missing a basic bit of understanding with modal forms.
This is the problem I have:

1. User clicks button on form, event handler throws an exception.
2. In catch block a form is shown modally (i.e. errForm.ShowDialog
()).
3. When the user closes the dialog the form image stays on the screen
and the app stops painting.

I'm using C# with .Net 1.1. This isn't repeatable and try as I might I
can't get this to reproduce in a small sample app (which suggests a
problem with my 'big' app). What I'd like, is a detailed discussion of
modal forms. Does anyone have such a resource?

Many thanks,
Nick Gardner
http://seecharp.blogspot.com/

Nov 16 '06 #1
3 1334
I dont think its the modal nature of the form that will be causing you an
issue but what you do after the form has been closed. Could you post a code
sample of the catch block at least?

Ciaran O'Donnell

"nick_nw" wrote:
Hi All,

I think I'm missing a basic bit of understanding with modal forms.
This is the problem I have:

1. User clicks button on form, event handler throws an exception.
2. In catch block a form is shown modally (i.e. errForm.ShowDialog
()).
3. When the user closes the dialog the form image stays on the screen
and the app stops painting.

I'm using C# with .Net 1.1. This isn't repeatable and try as I might I
can't get this to reproduce in a small sample app (which suggests a
problem with my 'big' app). What I'd like, is a detailed discussion of
modal forms. Does anyone have such a resource?

Many thanks,
Nick Gardner
http://seecharp.blogspot.com/

Nov 16 '06 #2
Try placing an Application.DoEvents(); after the .ShowDialog() line.
Also, is this a multi-threaded application where maybe the threads are
not background threads? Just some thoughts.

nick_nw wrote:
Hi All,

I think I'm missing a basic bit of understanding with modal forms.
This is the problem I have:

1. User clicks button on form, event handler throws an exception.
2. In catch block a form is shown modally (i.e. errForm.ShowDialog
()).
3. When the user closes the dialog the form image stays on the screen
and the app stops painting.

I'm using C# with .Net 1.1. This isn't repeatable and try as I might I
can't get this to reproduce in a small sample app (which suggests a
problem with my 'big' app). What I'd like, is a detailed discussion of
modal forms. Does anyone have such a resource?

Many thanks,
Nick Gardner
http://seecharp.blogspot.com/
Nov 16 '06 #3

justin creasy wrote:
Try placing an Application.DoEvents(); after the .ShowDialog() line.
Also, is this a multi-threaded application where maybe the threads are
not background threads? Just some thoughts.

nick_nw wrote:
Hi All,

I think I'm missing a basic bit of understanding with modal forms.
This is the problem I have:

1. User clicks button on form, event handler throws an exception.
2. In catch block a form is shown modally (i.e. errForm.ShowDialog
()).
3. When the user closes the dialog the form image stays on the screen
and the app stops painting.

I'm using C# with .Net 1.1. This isn't repeatable and try as I might I
can't get this to reproduce in a small sample app (which suggests a
problem with my 'big' app). What I'd like, is a detailed discussion of
modal forms. Does anyone have such a resource?

Many thanks,
Nick Gardner
http://seecharp.blogspot.com/
Hi, thanks for the replies.

The catch bloc looks like this:

catch (Exception ex)
{
errForm = new errForm ();
errForm.Exception = ex;
errForm.ShowDialog ();
}

I've tried calling Application.DoEvents () to no avail.
I've tried all possible combinations of control.Invoke and BeginInvoke
(even though I've proven that all operations are on the main GUI
thread).
There is something else happening that can't be solved in a short code
sample. I do not say this lightly but I suspect a bug in the .Net 1.1
framework. Unfortunately I can not produce a small test program that
reproduces the bahaviour (I know how this sounds, must be my app right?
Look, I'm not ruling anything out).
What I want is to develop an in depth understanding of modal forms.
What would be the best resource (short of Rotor, CLR specs, and other
such dry sources)?

Many thanks,

Nick

Nov 16 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: martin de vroom | last post by:
Hi, I have a web page that opens a modal dialog (client side) in the following manner onclick="window.showModalDialog('/dialog.asp',null,'dialogHeight: 200px; dialogWidth: 400px; dialogTop:...
2
by: Matt | last post by:
I want to know how to submit the form data to a modal dialog window? The following is page1.asp, and when the user clicks submit button, it will post the form data to page2.asp by opening a new...
4
by: Kyralessa | last post by:
In Access 2000, I have a base form with a ListBox of conference registrants. In the form's declarations section I include Dim f as Form To add a registrant I'm doing this: Set f = New...
4
by: Paul Aspinall | last post by:
Can anyone advise how to display a form on top, and modal, without using ShowDialog?? Thanks
23
by: Chukkalove | last post by:
Im sorry, I dont know the correct description for a hierarchy of parent and child forms. I have a main form that opens a child form modally. This child form in turn opens it's own child form...
2
by: Mike | last post by:
Hi, I'm having a problem with modal forms on windows. I've written a very short test program, with a main window and a form called from the main window. The form is set to modal with...
2
by: diogenes | last post by:
I have created many shortcut/popup (aka context, or right-click) menus for my application - instead of toolbars or standard drop-down menus. Within my custom menu, I am using...
4
by: =?Utf-8?B?Z2luYWNyZXNzZQ==?= | last post by:
I am trying to close/dispose multiple instances of a form but because they are modal and hidden, they do not show up in My.Application.OpenForms. They must be modal, so making them modeless is not...
1
by: Mohit | last post by:
Hi all, I am working on a windows based client server application with multiple forms. All forms are having custom title bars with no default bars. There is one main form. Some forms are opened up...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.