473,795 Members | 3,457 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Virtual desktop makes .NET modal dialog panels disappear

At work we are using a virtual desktop manager called AltDesk
(http://www.astonshell.com/), and it is causing a weird and extremely
annoying problem with the VB.NET application I am developing.

If I start my app, open a test form using ShowDialog() (this is a
menu choice on the main app), and then switch to a different virtual
desktop, the test form immediately closes (in what seems to be an
abnormal way -- the Closing event is raised, but the Closed event
is not). This behavior means that while a modal form is open I
can't switch to another desktop and do something different. I think
this rather defeats the purpose of having virtual desktops! This
behavior occurs only when a form is is opened modally -- there are
no problems when the same form is opened using Show(). I have not
seen this behavior with any other applications.

What I need to know of course is whether anyone else has seen this
behavior, whether it is a bug or a feature (in either .NET or
AltDesk), and most important, whether there is a fix or workaround.
I would be most grateful for any ideas or suggestions!

Here are some observations (note code at bottom of post):

The problem only occurs if the form is waiting for input. If there
is code inside my test form that is grinding away doing some work
then I can switch to another desktop, and if I switch back before
the work is complete the form does not close. However if I don't
switch back the form closes when the work is finished and the form
is ready for more input.

Note the commented code in XYZ_Closing. If I set the DialogResult
then the Closed event *does* in fact get raised when a change of
desktop triggers a close. If no work is done in XYZ_Closing then
the Closed event is not raised (i.e., XYZ_Close is never called).

Canceling the close in XYZ_Closing, as one would expect, makes the
form (and by extension the application) impossible to close. That
is, until I switch to another desktop -- when I do that the form
instantly closes, just as if there had been no cancel.

And here's something really strange. Suppose I call ShowDialog
twice in a row (see below). And suppose that after the form pops
up for the first time I then switch to another desktop. What
happens is that the first instance of the form closes, then when
ShowDialog() is called again the form pops up again -- this time
on the new desktop. But strangely, although invoked using
ShowDialog(), the second form is not modal! Perhaps relatedly,
the second instance of the form does not close if I switch to other
desktops. The end result is that I can go back to the application,
invoke my test code again, and end up with multiple functional
copies of what ought to be a modal form. This just seems bizarre!

Anyway, here is some skeletal code:

Dim xxx as New XYZ
xxx.ShowDialog( ) 'Pops up in normal way on initial desktop.
xxx.ShowDialog( ) 'Pops up on new desktop, and is not modal.

....

'This is my test form.
Public Class XYZ
Inherits System.Windows. Forms.Form

'The usual stuff, followed by some test code...

Private Sub XYZ_Closing(ByV al sender As Object, ByVal e As System.Componen tModel.CancelEv entArgs) Handles MyBase.Closing
Debug.WriteLine ("Closing")

'Me.DialogResul t = DialogResult.Ye s
'Debug.WriteLin e("DialogResu lt set to Yes")

'e.Cancel = True
'Debug.WriteLin e("Canceled!" )
End Sub

Private Sub XYZ_Closed(ByVa l sender As Object, ByVal e As System.EventArg s) Handles MyBase.Closed
Debug.WriteLine ("Closed")
End Sub
End Class
--
John Brock
jb****@panix.co m

Aug 28 '06 #1
2 1680
John Brock wrote (in six (!) newsgroups):
If I start my app, open a test form using ShowDialog() (this is a
menu choice on the main app), and then switch to a different virtual
desktop, the test form immediately closes (in what seems to be an
abnormal way -- the Closing event is raised, but the Closed event
is not). This behavior means that while a modal form is open I
can't switch to another desktop and do something different. I think
this rather defeats the purpose of having virtual desktops! This
behavior occurs only when a form is is opened modally -- there are
no problems when the same form is opened using Show(). I have not
seen this behavior with any other applications.

What I need to know of course is whether anyone else has seen this
behavior, whether it is a bug or a feature (in either .NET or
AltDesk), and most important, whether there is a fix or workaround.
I would be most grateful for any ideas or suggestions!
I haven't seen that behavior, but I use MSVDM [Virtual Desktop
Manager], not AltDesk. With MSVDM, I lose popup tooltips in my
WinForms apps after switching to a different desktop and then
switching back. This happened with WinForms 1.1 and still happens in
2.0.

A customer's apps that used VS-like dockable, autohide toolwindows
(from Janus) would get horribly confused after switching desktops.

I haven't found any workaround or fix for these issues, but take
(some) comfort from the way that Excel doesn't handle virtual desktops
well, either - a maximized Excel window loses its toolbars and menus
after a desktop switch, and there doesn't seem to be any way to get
them back. The fault *seems* to lie with the virtual desktop managers
- it looks like Windows wasn't really designed to support virtual
desktops, and the managers have to play various tricks to get it to
mostly work. Perhaps vdm-s will be solider under Vista.

--

..NET 2.0 for Delphi Programmers www.midnightbeach.com/.net
Delphi skills make .NET easy to learn In print, in stores.
Aug 28 '06 #2
On 28/08/2006 in message <ec**********@r eader2.panix.co mJohn Brock wrote:
>At work we are using a virtual desktop manager called AltDesk
(http://www.astonshell.com/), and it is causing a weird and extremely
annoying problem with the VB.NET application I am developing.
If you are running it on XP have you tried it with the MS Desktop manager
which is a power toy I think? Just in case it's AltDesk causing the issue.

--
Jeff Gaines
Aug 28 '06 #3

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

Similar topics

2
12249
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: 300px; dialogLeft: 150px; edge: Sunken; center: Yes; help: No; resizable: No; status: No;');"> and the page loads in the modal dialog no problem.
2
6735
by: Gilles T. | last post by:
Hi, How I can refresh a modal dialog in asp.net? I open a modal dialog in first with a dropdownlist. To add a element in my dropdownlist (table), I open a second modal dialog to ask element and save. When I return in my first modal dialog, dropdownlist is not refreshed. I don't know how to refresh my first modal dialog to view my new element in the dropdownlist. Thanks to help me with this problem!
2
2561
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 bring up a modal dialog (MessageBox)
10
2756
by: Guadala Harry | last post by:
I have a modal dialog that currently does all of the following except item 4. 1. lets users select a graphic from a list of thumbnails (and when selected, displays the full-size image in a preview DIV) 2. when users close the dialog, the application receives the URL to the selected graphic. 3. the modal dialog lets the users upload a new graphic if the dialog does not present them with one they are already happy with. 4. upon uploading...
2
1595
by: John Brock | last post by:
At work we are using a virtual desktop manager called AltDesk (http://www.astonshell.com/), and it is causing a weird and extremely annoying problem with the VB.NET application I am developing. If I start my app, open a test form using ShowDialog() (this is a menu choice on the main app), and then switch to a different virtual desktop, the test form immediately closes (in what seems to be an abnormal way -- the Closing event is raised,...
2
3688
by: sthrudel | last post by:
Hi! I'm working on a web application in Asp.net and what I would like to have is a cross borwser modal dialog which accepts user's input. I would like to catch what the user clicked on the dialog. To be more specific I want to have a confirmation dialog that is shown when a user clicks on a Delete button (which deletes some values from database). If Yes is pressed the delete action is processed otherwise modal dialog is closed.
3
3046
by: frosted74 | last post by:
Hi, I have 2 javascript functions, one that sorts a table and one that shows/hides a modal dialog that displays something like "Sorting" with a little icon indicating that the browser is "busy" and you need to wait. This is done because on larger tables the sort routine can take upwards of 10 seconds. I try the following code: <th onclick="showModal(); sort(this); hideModal();">some header</th>
3
1874
by: Andrea Gasperi | last post by:
Hi there not sure if this is the right place but i'm proud to use for the first time the "Managed Newsgroups" feature of my brand new MSDN subscription :-) So here is the problem. I've configured a page with five panels that I use with the modal popup extender. This panels are nested in web controls. Page structure is not that simple but works well. The only (big) problem is that when the page is loaded all the panels used
0
9672
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
9519
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10001
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9042
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
7538
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
6780
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
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3723
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2920
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.