473,804 Members | 3,194 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Modal Windows

Hi,

I have a main form, which i use to open secondary forms. From the
secondary form i need to open a Modal Window in such a way that, my
secondary form is blocked, but i can still access my main forms, and
open other secondary windows.

(An exact analogy for my problem is the Yahoo Messenger, where i can
open any number of chatwindows from the main messenger window; and
from the chat windows i can invoke the File Trasnfer option, which
opens a modal disalog. But even when the File Transfer dialog is
opened, i can still go to the main messenger window and open other
conversation windows)

Any suggestions on how to achieve this?

Regards,
Ankit!!
Jan 17 '08 #1
3 2477
Ankit,

The only way I can think of to do this would be to open the other
windows on other threads. This means that you will have to run message
pumps on those threads. Then, the calls to open a modal dialog should be
applicable for just the window on that thread.

Of course, make sure when making calls between windows, that you are
using the Invoke method. Since the windows are on other threads, all calls
you make to the UI in other threads needs to be marshaled to the correct UI
thread.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

<aa*******@gmai l.comwrote in message
news:cd******** *************** ***********@21g 2000hsj.googleg roups.com...
Hi,

I have a main form, which i use to open secondary forms. From the
secondary form i need to open a Modal Window in such a way that, my
secondary form is blocked, but i can still access my main forms, and
open other secondary windows.

(An exact analogy for my problem is the Yahoo Messenger, where i can
open any number of chatwindows from the main messenger window; and
from the chat windows i can invoke the File Trasnfer option, which
opens a modal disalog. But even when the File Transfer dialog is
opened, i can still go to the main messenger window and open other
conversation windows)

Any suggestions on how to achieve this?

Regards,
Ankit!!
Jan 17 '08 #2
One other possibility is to not show the dialog as modal, rather just show
it and set it's owner. When the dialog shows, it set's the owner's Enabled
property to false, and on close it sets it back to true.

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c omwrote in
message news:A4******** *************** ***********@mic rosoft.com...
Ankit,

The only way I can think of to do this would be to open the other
windows on other threads. This means that you will have to run message
pumps on those threads. Then, the calls to open a modal dialog should be
applicable for just the window on that thread.

Of course, make sure when making calls between windows, that you are
using the Invoke method. Since the windows are on other threads, all
calls you make to the UI in other threads needs to be marshaled to the
correct UI thread.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

<aa*******@gmai l.comwrote in message
news:cd******** *************** ***********@21g 2000hsj.googleg roups.com...
>Hi,

I have a main form, which i use to open secondary forms. From the
secondary form i need to open a Modal Window in such a way that, my
secondary form is blocked, but i can still access my main forms, and
open other secondary windows.

(An exact analogy for my problem is the Yahoo Messenger, where i can
open any number of chatwindows from the main messenger window; and
from the chat windows i can invoke the File Trasnfer option, which
opens a modal disalog. But even when the File Transfer dialog is
opened, i can still go to the main messenger window and open other
conversation windows)

Any suggestions on how to achieve this?

Regards,
Ankit!!
Jan 17 '08 #3
Any suggestions on how to achieve this?

A search on MDI might help? threading is a bit complicated... win dont
like modal/always on top if there are more than one
//CY
Jan 26 '08 #4

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

Similar topics

0
1849
by: Nonoy of Philippines | last post by:
Hello, guys... I'm just starting to develop web applications and I have this problem regarding Session objects At some parts of my application, I open modal dialog window which also opens another window to display a report. To do this, I use the values of Sessions I initialize at the windows that called the modal dialog box. However, I noticed that the values of my Sessions were gone when I opened the modal dialog window ONLY when...
0
413
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. There is a reference to Unsafe Native Methods and Callback functions, but Interop Services are not used. What is going on ? The problem does not occur if the form is made modal. Any thoughts would be appreciated. The code appears below for a simple...
3
8153
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 the code is 100% managed. The exception is not thrown if the dialog was modal (opened with ShowDialog()) or if the selection is made from, say, a ListBox. I have included a simple example below. I am using C#.NET 2003, Standard Edition.
8
2740
by: Stephen Rice | last post by:
Hi, I have a periodic problem which I am having a real time trying to sort. Background: An MDI VB app with a DB on SQL 2000. I have wrapped all the DB access into an object which spawns a thread to access the database and then displays a modal dialog which allows the user to cancel the task, if it is taking longer than they want, and shows them a display of how long the query has been running so far.
5
2084
by: jacquesvdz | last post by:
Hi Hope you guys can help me with this? I live in a house with 10 people.In the beginning wehn there were only two people, I gave them my password for the use of my pc. But since I got Internet at my home, everybody thinks its fun to use my pc.
23
2742
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 modally. I also have a separate thread running that monitors a card reader. If the user removes the card then the thread calls back the main form to tell it that the card was pulled. The main form should then close down any children leaving the main...
2
2651
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 form.setModal(1) before calling form.show(). All works as expected on Linux. The form is modal, not allowing the main window to received the focus. If I call the form from within itself, the topmost form is modal, and not of the previous forms will...
4
10637
by: John Kotuby | last post by:
Hi all... I am bulding an application and wish to use custom Modal dialog windows. According to a couple of recent articles I have seen, the newer Mozilla browsers (actually I think they said Netscape) supported syntax like : window.open(URL ,"diagwin","modal=1, width=30"); For IE I use : window.showModalDialog
2
4503
by: =?Utf-8?B?TmF0aGFuIFdpZWdtYW4=?= | last post by:
Hi, I am wondering why the .NET Framework is quite different from Win32 API when it comes to displaying system modal message boxes. Consider the four following types of system modal message boxes (please see associated source code below): 1) Win32 API with context ("btnWin32WithContext_Click") 2) .NET Framework with context ("btnFrameworkWithContext_Click") 3) Win32 API withOUT context ("btnWin32WithOUTContext_Click")
0
9706
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10578
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10332
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10321
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9152
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7620
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6853
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5522
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3820
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.