.net - Main Form Minimized When Modal Dialog Calls Me.Hide()?

Mar 22, 2011

sometimes (not everytimes), when I call the Me.Hide() in a form, which I called with .ShowDialog(), the main form, which called this dialog minimized.

View 2 Replies


ADVERTISEMENT

Calling Showdialog() On A Form - From The Main Form's OnLoad Event Makes The Modal Dialog Go Away After A Few Seconds?

Aug 7, 2009

I'm having an interesting issue that I can't reproduce on a different project, but can consistently on this one. I have no clue what might be causing it, but am hoping that someone may have seen it before.

I have a main form, from which I run a series of checks. On this form, I have a listview control. Because of some issues with the refreshing of this listview control, I had to create my own messagebox. It's just a form that displays some text ( it also happens to look nicer than MsgBox; in my opinion, anyways ). It's been working great for months, until recently.

My problem is that on my main form's load event, I run this check, which returns an error within a try/catch block. I then call my custom messagebox with a message. It in turns calls it's ShowDialog() function.

In any other situation ( after the main form has been loaded ), I have no problems. The messagebox goes on the screen and behaves appropriately ( ie: waits for my input and acts as a modal dialog ( stops execution of my main form's thread ) ). However, on this onload event, my messagebox comes up and goes away almost immediately afterwards.

I've traced it all the way to the showdialog() call. For no explicable reason, it appears to skip right over this call, without me doing anything on the form.

Here's what the inner trace looks like ( when I put a breakpoint on the onclosing event for this messagebox form ):

CODE:

View 10 Replies

Find When Dialog / Modal Form Is Shown For My Main Form?

Feb 3, 2010

I want to be able to check if there is currently a dialog or modal form shown for my form so that I can close it.
Is there a way to do this?

View 1 Replies

VS 2008 : Modal Form Hide Instead Of Close - Main Form Does Not Close

Mar 20, 2009

I have a main form that has a button with which a smaller form is shown. Think of the smaller form as the Find/Replace dialog in many applications, such as Notepad. It's important that the form is (what I believe is called) modal. What I mean is that it always stays on top of the main form. I ensure that by calling the Show method with "Me" as the owner argument. Whenever the small form loses focus it will not disappear into the background but stay visible (albeit out of focus). If you don't understand open up Notepad and have a look at the behavior of the Find/Replace dialog.

Here's my problem: instead of actually closing the form when the X is pressed, I want it to simply Hide itself, so its position and the state of any controls (checkboxes etc) is preserved automatically.To achieve this I simply cancel the FormClosing event and Hide it:

vb.net
Private Sub Form2_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing

[code]....

To show the form, I use the following (note the (Me) to make the main form the owner of the form; this ensures that it remains visible even when it is out of focus):

vb.net
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Form2.Show(Me)
End Sub

Now. When I run my project, and open the Form2 (small form), then hide it again (by 'closing' it), I can no longer close the main form (Form1)! It seems the main form cannot close when the small form still exists (albeit invisible)...?? When I don't use the Me argument in the Show method, I don't get the behavior I want. I know I can set the TopMost property to True but that will also cause it to become visible on top of all the other forms, even windows not part of my application.

View 8 Replies

Main App That Calls A Dll With A Form In It?

Mar 3, 2012

I have my main app that calls a dll with a form in it. Is there a way to make my main app be the owner to the dll form?

View 7 Replies

Forms :: Main Form Minimized After Opening Form In A Different Thread?

Jun 7, 2009

In the main form the user can choose to download information from a device.Since this request takes time, when "download information" is pressed I open new form in a separate thread: Private Sub RunDownload()

[Code]...

View 3 Replies

How To Temporarily Hide A Modal Form

Mar 29, 2009

I've created an Excel COM add-in that has several forms. The application has the following forms:

FormA (Modeless): Excel.Application is parent
FormB (Modal): FormA is parent
FormC (Modal): FormB is parent

[code].....

View 3 Replies

Error While Showing A Modal Dialog Box Or Form

Jun 23, 2009

I am checking emailId exists in DB, If ExistsI am looking to create a Ok/Cancel confirmation dialog.if user say "Ok" I am redirecting to some other form.[code]...

View 3 Replies

Minimizing A Modal Form Minimizes Parent Or Main Application?

Jun 2, 2009

Is it possible to have an application where form1 opens a second modal form (form2) and then allows the user to minimized form2 causing the entire application to minimize to the taskbar.(form2 is never shown in the taskbar) A simple example of this is winzip where a second modal progress window is opened which can be minimized?

View 10 Replies

Modal Dialog With Secondary Form Shown In Taskbar?

Jul 21, 2009

I have two forms for my application, that are visible in the Windows taskbar. When a modal dialog is popped up on the main form, the secondary form is locked. However, when the user clicks on the secondary form on the taskbar, it appears over the modal dialog box, and is basically frozen. Is there a way to ensure that the modal dialog box does not draw underneath the secondary form? The topmost property is no good, since this draws on top of everything, even stuff not related to the application.

View 1 Replies

Mdi Form And Show Form - Error "Form That Is Already Visible Cannot Be Displayed As A Modal Dialog Box"

Jan 26, 2010

I'm new in .Net and I have an application with windows form "LOGIN" When users enter the user and password and click "ok", then if user passes validation then I have the code Show(MDIMainMenu) (I'm trying to open an mdi form), but I receive the following error: "Form that is already visible cannot be displayed as a modal dialog box. Set the form's visible property to false before calling Show. Error Number 5"

[Code]...

View 2 Replies

Showing A Modal Dialog Box Or Form When The Application Is Not Running In UserInteractive Mode Is Not A Valid Operation?

Sep 5, 2008

I am writing a web application using .net 3.5 and vs 2008 which allows people to add data to a db via a control panel front end.Objective: Before committing one of the fields to the db i would like the user to answer Yes, No or Cancel to confirm their action. I have tried to implement this with a modal dialog box or message box but the following error appears: Server Error in '/' Application.

View 10 Replies

Forms :: Modeless Dialog Active When Modal Dialog Displayed?

Nov 16, 2010

Is there a way to launch a Modeless Dialog that stays active even when a Modal Dialog is launched? Can I put the Modeless Dialog in a seperate Thread or something like that?

View 3 Replies

Hide My Main Form?

Feb 10, 2011

Is it possible to hide the main form OR use the a similar thing to vb6 and launch use a "Sub Main()" in a module?[code]...

View 10 Replies

Modeless Dialog Active When Modal Dialog Displayed

Nov 16, 2010

Is there a way to launch a Modeless Dialog that stays active even when a Modal Dialog is launched? Can I put the Modeless Dialog in a seperate Thread or something like that?

View 12 Replies

Hide The Main Form When It Is Loaded?

Oct 21, 2009

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Hide()
End Sub

I want to hide the main form when it is loaded, but the code above doesn't work. Can anyone show me how to do that?

View 2 Replies

How To Completely Hide Main Form Upon Startup

May 25, 2011

How to hide the main form upon load (startup)??? I have tried Me.Hide() And some others ones, but none of them actually HIDE the form upon startup. It also has a NotifyIcon but once again it will not hide the main form..

View 6 Replies

Minimimizeing Main Form While Dialog Is Open?

Oct 15, 2011

How can I have the Main Form of my app mininized while a Dialog is stil open and avalable for resieving text from the user.

View 4 Replies

[2005] How To Use Bindingsources From Main Form On Dialog Form?

Mar 2, 2009

My project has a single dataset with about 6 datatables. Each of those datatables has a TableAdapater and a Bindingsource on the main form (due to various databound controls).

Now, I want to have a second form for adding a new record. If I bind the controls to the datasource it creates new TableAdapaters and new Bindingsources on that form. I was wondering if it's possible to simply use the ones from the main form instead like this

[code...]

View 3 Replies

User Controls Hide And Show In Main Form

Feb 8, 2012

I have a couple of user controls, which I show in my main form.

So let's say here's what i want:
Sub Show_Control1()
UserControl1.Show
'CODE TO HIDE EVERY OTHER DISPLAYED USER CONTROL ON THE MAIN FORM
End sub

Right now I have to hide them one by one with hide, because I don't know what's the current displayed form.

View 2 Replies

VS 2008 Make Main Form Inaccessible Until User Closes Dialog Box?

Apr 11, 2010

A program I'm developing launches dialog boxes to get information from the user. Right now, the user can still click on and manipulate the main form while the dialog box is open. How can I make the main form inaccessible until the user closes the dialog box?

View 2 Replies

Close A Modal Form From Who Initiated Modal One?

Feb 25, 2011

I have a parent form (form1), which is calling a second form (form2) as modal.[code]...

No form2 is modal. Closing this form2 from the form itself is clear.But how can I close the form via myform2.close from form1 via an event handler?

View 6 Replies

Display A Modal Dialog Without Dispalying Other?

May 20, 2010

I have a large VB.Net 2008 rich client database app and in it some screens take a bit to load, 1 - 5 seconds and two of them take up to 15 seconds. Right now I have a me.hide in my form load, I do my loading of drop downs and data, then do a me.show. It works decent and gives the impression that the program is quick. What I would like to do however is have a "waiting" or "loading" screen with a animated gif pop up while it's doing its data loads.

So I created a "WaitingForm" that has no border and a single picture box. In the form load of this waiting form it assigns a animated gif to the picture box. I set the form to be top most, no control box, etc.

If I call this waiting from from within my from load events as WaitingForm.show the animation doesn't work and the form only half shows (and in the wrong place on the screen). If I call this form using a WaitingForm.ShowDialog it correctly shows in the center of it's parent and displays the animated icon BUT blocks the calling form from processing and defeats the entire purpose.

How do I display the waiting form like it's a dialog box so it correct centers on it's parent and displays correctly but doesn't block the lower form from processing? Currently when I call the waiting form I give it a integer for how many seconds to display and then a timer on the waiting form counts down and closes itself. Do I need to use a worker thread and if so what is the easiest way to do this so the code is reusable from multiple different screens?

View 14 Replies

Evaluating Modal Dialog Result?

Apr 4, 2011

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
With Me.PrintForm1

[Code]....

View 6 Replies

Modal Dialog With Multiple Forms

Jul 21, 2009

Is there a way to specify what forms are Locked when opening a Modal Dialog? I want to have a specific form available even if a Modal dialog is opened. The form in question is a child form (Accessible from the Windows application bar), that is created from the main application form. The Modal Dialog should only lock the main application form, and not the secondary window. Is it possible to make a secondary form independent from the main application form?

View 1 Replies

Yielding Events To IE In Modal Dialog?

Jun 26, 2009

Windows Vista SP1 Internet Explorer 8 .NET 3.5 Visual Studio 2008 I have written a UserControl with VB.net that is embedded within a web page. The web-page also includes several iframes containing other interfaces.

One of the pages is defined to auto-refresh every 10 minutes (to keep a session object open on the web server). When the UserControl is displaying its main interface, the refresh in the IFRAME fires and updates OK. However, if I open a dialog (using the ShowDialog method) the refresh still fires OK but the IFRAME does not update until the dialog is closed. Presumably, this is because the dialog is Modal.

What I'd like to know is if there is any method of yielding events within the modal dialog that would allow the IFRAME within IE to update?

I tried adding a timer to the dialog and calling Application.DoEvents every few minutes but this did not appear to work. Not found any info on the net either.I don't really wan't to go down the route of creating some sort of semi-modal dialog class (i've yet to find one in the default .NET API - is there one?) as it would mean a lot of re-work so before I go down that route I thought I'd see if anyone can think of a alternative solution.

View 3 Replies

C# - Fading Background While Modal Dialog Shown

Jul 1, 2011

When shutting down a Windows XP system, it displays a modal dialog box while the background fades to a grayscale. I will like to achieve the same effect in any of the programming languages in the tag list.

View 1 Replies

Expect Some Dialog Window To Appear In A Non-modal State?

Apr 19, 2009

If I type this code (VB.net 2003):

Dim myDialog As frmTestDialog
myDialog = New frmTestDialog
myDialog.Show()

you'd expect some dialog window to appear in a non-modal state. For some reason, this isn't the case with a program I am working on. Most of the dialogs use ShowDialog() to open them, and one uses Show(). The second I try to show another non-modal dialog, the dialog appears in a modal state. Another strange thing is, before I show the dialog, there is code to shift the dialog location to centre it on the main form - this isn't executed either: the dialog appears at 0,0.

My usual trend is to blame myself for errors (usually the case), then I blame the software; I have checked every single line of code (including the generated code), and it all checks out - the dialog should be non-modal. But ... it's not. I've come across other errors in VB.net 2003; is this another instance?


I'll try creating a new dialog and displaying this non-modal, and see what happens. If it works, I can just transplant the code but this shouldn't be happening, just like if I go to a shop, ask for a cola, I expect a cola not a Chinese panda; more annoying, I return the panda, ask for a cola, and they give me the panda back do loop until I give up The system does using threading, but none of that code connects to the display dialog routines all dialogs are opened with more-or-less the above code (a few have simple validation routines).

View 5 Replies

Halt All Other Execution While Modal Dialog Box Is Showing?

Oct 22, 2009

I'm currently trapping all unhandled exceptions in my VB.net app to apply logging,but I still want to be able to halt and/or stop app.while displaying a dialogbox similar to the builtin unhandled exception dialogbox, where app. seems to stop to a grind until user presses continue.I think I perhaps need to start the dialogbox as part of another application, but I don't know if I'm able to halt the erroneous app.

View 11 Replies

MessageBox Not Showing From Modal Dialog Window

Jul 5, 2011

I am trying to show a message box when an error occurs in a modal dialog window but for some reason the message box is never shown although I know the MessageBox.Show method is being hit. The try catch block is inside of an event handler for a windows form that is being shown as a modal dialog. I know that the event is being fired and that the error is being caught but the message box never opens. I've replaced the MessageBox.Show with another form show and it works fine but I'd rather use MessageBox instead of creating my own error form. I just can't seem to make MessageBox work. Is this a limitation of MessageBox? Here is a simplified version of what I am doing:

[Code]...

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved