473,396 Members | 2,020 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,396 software developers and data experts.

Help: Questions regarding Modal forms

I have some questions regarding Modal forms and would appreciate if someone
could clarify my understanding.

(a) I observed that the modal form's Form_Closing event is generated if I
set the modal form's Visible property to False or call its Hide method. Is
this true? or is it a result of something that I am doing incorrectly?

(b) The ShowDialog method halts all other execution in a single threaded
program till the modal form is closed, right?

(c) I noticed that if I Hide the modal form or set its Visible property to
False, then the ShowDialog method returns. Is this correct behaviour? Is
there a way to avoid this?

TIA.
Nov 21 '05 #1
3 1409

(a) I observed that the modal form's Form_Closing event is generated if I
set the modal form's Visible property to False or call its Hide method. Is this true? or is it a result of something that I am doing incorrectly?
Yes it true.

(b) The ShowDialog method halts all other execution in a single threaded
program till the modal form is closed, right?
Yes with the exception of whatever is running in the modal form itself.
(c) I noticed that if I Hide the modal form or set its Visible property to False, then the ShowDialog method returns. Is this correct behaviour? Is
there a way to avoid this?


Yes it is. Dont show the form using showDialog. Use form.Show().

Richard
Nov 21 '05 #2
Hi Richard,

Thanks for your response.

I am using ShowDialog because I want the form to be displayed as a Modal
form. This form opens up another form and you can switch back and forth
between the 2 forms. Once both these forms are closed then I need to do some
processing on the main form, like adding an item to the TreeView of the main
form.

Do you have any sugesstions for the same? Currently what is happening is
that on Hide the Modal form returns and the main form processing takes place
too early.

TIA.

Nov 21 '05 #3
I think I found a solution to my problem.

Use ShowDialog for the 1st form. Show the 2nd form as an owned form. I made
the size and thelocations of the 2 forms equal, so although the form is an
owned form, it appears as if the 1st form has been hidden and only the 2nd
form is being displayed.
Nov 21 '05 #4

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

Similar topics

13
by: Aladdin | last post by:
I have an MS Access form on which I have a listbox listing tables in that database. I want to be able to click on any of those tables and view its contents on the same form using subforms or any...
0
by: Hector | last post by:
I have a ComboBox set up in a non-modal form. When a selection is made from the ComboBox, the handler code closes the form, but then the system crashes because of an unhandled NullReferenceException....
3
by: Andrew | last post by:
I get a Null Reference Exception if I close a non-modal dialog (that is, a form opened with Show()) when a selection is made from a ComboBox. The error message refers to Unsafe Native Methods, but...
2
by: cassidyc | last post by:
Hi, I was wondering if anyone has come accross this issue? And if they have any solutions I have that can create new copies of itself Form1 as = new form1(); af.show(); This form can also...
4
by: Johnny Jörgensen | last post by:
In my current project I've got some DataGridViews containing multiple hidden columns. For some reason 8 of the 10 grids I've got on my form has suddenly started showing 1 of the hidden columns...
11
by: VK | last post by:
In the continuation of the discussion at "Making Site Opaque -- This Strategy Feasible?" and my comment at http://groups.google.com/group/comp.lang.javascript/msg/b515a4408680e8e2 I have...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.