473,651 Members | 2,743 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

showdialog throws exception when closes


Dim f As New frmWeb
f.ShowDialog(Me )
f.Dispose()
Annytime i call a diffrent form from my main form using showdialog, i get an
exception eror thrown when i close the form, but when i use f.show i don't
get any errors, i need the knew form to keep the focus until closed.

thank you
Jul 21 '05 #1
3 2721
GATMAN <GA****@discuss ions.microsoft. com> wrote:
Dim f As New frmWeb
f.ShowDialog(Me )
f.Dispose()
Annytime i call a diffrent form from my main form using showdialog, i get an
exception eror thrown when i close the form, but when i use f.show i don't
get any errors, i need the knew form to keep the focus until closed.


What's the exception?

Could you post a short but complete program which demonstrates the
problem?

See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #2

Anytime i use form.showdialog () instead of form.show() the following error
occurs,

An unhandled exception of type 'System.Runtime .InteropService s.SEHException'
occurred in system.windows. forms.dll

Additional information: External component has thrown an exception.

Then if i click the break button, "frmNetForm " is highlighted in the
debugger with the green arrow in the left column in the begining of my class,

Public Class frmNetForm
Inherits System.Windows. Forms.Form

The error always occurs when i close the form i called, it happens when i
call any of the other foms in the project using .showdialog.


"Jon Skeet [C# MVP]" wrote:
GATMAN <GA****@discuss ions.microsoft. com> wrote:
Dim f As New frmWeb
f.ShowDialog(Me )
f.Dispose()
Annytime i call a diffrent form from my main form using showdialog, i get an
exception eror thrown when i close the form, but when i use f.show i don't
get any errors, i need the knew form to keep the focus until closed.


What's the exception?

Could you post a short but complete program which demonstrates the
problem?

See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Jul 21 '05 #3
GATMAN <GA****@discuss ions.microsoft. com> wrote:
Anytime i use form.showdialog () instead of form.show() the following error
occurs,

An unhandled exception of type 'System.Runtime .InteropService s.SEHException'
occurred in system.windows. forms.dll

Additional information: External component has thrown an exception.

Then if i click the break button, "frmNetForm " is highlighted in the
debugger with the green arrow in the left column in the begining of my class,

Public Class frmNetForm
Inherits System.Windows. Forms.Form

The error always occurs when i close the form i called, it happens when i
call any of the other foms in the project using .showdialog.


As I said before, please give a short but complete program which
demonstrates the problem.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #4

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

Similar topics

0
2094
by: Tomasz Naumowicz | last post by:
Hello Everybody, I have the following problem with Socket: Socket.Available reports data in the buffer (e.g. 1849 bytes) but I can't read it because Socket.Read throws an exception The exception ist being thrown because the connection is already closed. How could I read the data from the buffer? background information: I open multiple connections to my Windows 2003 Web Server (simple HTTP GET).
5
1586
by: Josh Golden | last post by:
3 forms. form 1, when button clicked instantiates form 2 which opens but is not shown. form 2 instantiates form 3 as showdialog. form 3 finishes, raises an event that form 2 catches. during the catch, form 2 closes and disposes the instance of form 3, opens itself as showdialog, and displays some data to the user. the user can select one of these data and upon doing so raises an event that form 1 catches (and closes and disposes of...
4
1321
by: Strahimir Antoljak | last post by:
I keep an ArrayList in the external class. The external class is passed into a form via New constructor (see below). I process some data with functions within the form before showing the form. I populate the array contained in the passed class, then I show the form modally (frm.ShowDialog) so the user can interact, and when the user closes the form, the array is emtpy. Why?????? I check the Count property before, and after the showing the...
1
2441
by: No Sheds | last post by:
Hi I have an MDI application. I have a MDI child window within this application that shows another form using ShowDialog. This works fine, except that the final form shown with ShowDialog can't be an MDI child window, and so can appear outside the boundaries of the main window. I know I can do something like this: private withevents FinalForm as someform
4
5223
by: trialproduct2004 | last post by:
Hi all I am new to vb.net application. I am using showdialog property of form to display form. First time it is working properly. But next time it is giving me error that ' object reference not set to an instance of an object'. When i went through stacktrace, i found that it is giving error in showwindow. I am not getting why it is happening.
3
293
by: GATMAN | last post by:
Dim f As New frmWeb f.ShowDialog(Me) f.Dispose() Annytime i call a diffrent form from my main form using showdialog, i get an exception eror thrown when i close the form, but when i use f.show i don't get any errors, i need the knew form to keep the focus until closed. thank you
4
12373
by: randy1200 | last post by:
I have a SideForm. If the use presses a button on the main form, the side form comes up by executing the following: SideForm sf = new SideForm() sf.ShowDialog(); This works perfectly. I've been asked to change the code to the following:
2
4413
by: =?Utf-8?B?a2VubmV0aG1Abm9zcGFtLm5vc3BhbQ==?= | last post by:
vs2005, c# Trying to understand why one way works but the other doesnt. I have not tried to create a simpler mdi/child/showdialog app for posting purposes (I think even this would not be so small or simple). I am hoping the description will generate some ideas I can check out. PROBLEM: ----------------- Switching to UI thread using Invoke(), everything seems good.
6
32745
by: NVergunst | last post by:
I have a main form, then this form spawns another form (Form A) as a form.showdialog(). That dialog box then has a button that spawns another form (Form B) through the form.showdialog(). All of this works fine. Now when I press a button on Form B, and set the "this.DialogResult = DialogResult.Cancel", then close, it goes back to FormA, and Form B closes. Then Form A closes and returns to the main form. This is not what I am wanting. I...
0
8357
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
8700
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
8465
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
7298
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
6158
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
5612
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
4144
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...
1
2701
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1910
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.