473,586 Members | 2,495 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Check is form is disposed

Hi,

How can i check is a form is disposed in framework 1.1
In framework 2.0 i can check Form.IsDisposed to check if a user closed the
form


Nov 21 '05 #1
5 15726
You have the IsDisposed property in 1.1 as well. However, the difference
here is that you will need a reference to the instance of the form unlike in
2.0 where you can just call the class name as you would do in VB 6.0.

However, I'm not sure if IsDisposed is the best way to determine whether a
form is closed or not. Its better to use the Closed event of the form within
which you can set some boolean indicating that the form has been closed.

for example:
Private bFormClosed as boolean = False

private sub Form1_Load(byva l sender as System.Object, byval e as
System.EventArg s) _
Handles Form1.Load
bFormClosed = False
end sub

private sub Form1_Closed(by val sender as System.Object, byval e as
System.EventArg s) _
Handles Form1.Closed
bFormClosed = True
end sub

then check the bFormClosed variable to determine whether the form is closed
or not.

hope this helps..
Imran.

"rob willaar" <lw****@xs4all. nl> wrote in message
news:41******** *************** @news.xs4all.nl ...
Hi,

How can i check is a form is disposed in framework 1.1
In framework 2.0 i can check Form.IsDisposed to check if a user closed the
form

Nov 21 '05 #2
Hi Imran,

Tnx for your reply.

I don't seem to have a .IsDisposed property on a reference to a form in
framework 1.1
This app will have a lot of forms so i don't like to have globals
"Imran Koradia" <no****@microso ft.com> schreef in bericht
news:Oz******** ******@TK2MSFTN GP11.phx.gbl...
You have the IsDisposed property in 1.1 as well. However, the difference
here is that you will need a reference to the instance of the form unlike in 2.0 where you can just call the class name as you would do in VB 6.0.

However, I'm not sure if IsDisposed is the best way to determine whether a
form is closed or not. Its better to use the Closed event of the form within which you can set some boolean indicating that the form has been closed.

for example:
Private bFormClosed as boolean = False

private sub Form1_Load(byva l sender as System.Object, byval e as
System.EventArg s) _
Handles Form1.Load
bFormClosed = False
end sub

private sub Form1_Closed(by val sender as System.Object, byval e as
System.EventArg s) _
Handles Form1.Closed
bFormClosed = True
end sub

then check the bFormClosed variable to determine whether the form is closed or not.

hope this helps..
Imran.

"rob willaar" <lw****@xs4all. nl> wrote in message
news:41******** *************** @news.xs4all.nl ...
Hi,

How can i check is a form is disposed in framework 1.1
In framework 2.0 i can check Form.IsDisposed to check if a user closed the form


Nov 21 '05 #3
IsDisposed is inherited from the Control Class.
Maybe something like this is what you need then:

If CType(oMyForm, Control).IsDisp osed then
'do something
end if

hope this helps..
Imran.

"rob willaar" <lw****@xs4all. nl> wrote in message
news:41******** *************** @news.xs4all.nl ...
Hi Imran,

Tnx for your reply.

I don't seem to have a .IsDisposed property on a reference to a form in
framework 1.1
This app will have a lot of forms so i don't like to have globals
"Imran Koradia" <no****@microso ft.com> schreef in bericht
news:Oz******** ******@TK2MSFTN GP11.phx.gbl...
You have the IsDisposed property in 1.1 as well. However, the difference
here is that you will need a reference to the instance of the form unlike
in
2.0 where you can just call the class name as you would do in VB 6.0.

However, I'm not sure if IsDisposed is the best way to determine whether a form is closed or not. Its better to use the Closed event of the form

within
which you can set some boolean indicating that the form has been closed.

for example:
Private bFormClosed as boolean = False

private sub Form1_Load(byva l sender as System.Object, byval e as
System.EventArg s) _
Handles Form1.Load
bFormClosed = False
end sub

private sub Form1_Closed(by val sender as System.Object, byval e as
System.EventArg s) _
Handles Form1.Closed
bFormClosed = True
end sub

then check the bFormClosed variable to determine whether the form is

closed
or not.

hope this helps..
Imran.

"rob willaar" <lw****@xs4all. nl> wrote in message
news:41******** *************** @news.xs4all.nl ...
Hi,

How can i check is a form is disposed in framework 1.1
In framework 2.0 i can check Form.IsDisposed to check if a user closed

the form



Nov 21 '05 #4
Rob,

I agree with Imran,

When a form is disposed means that it is been opened before.

Gives crazy program control in my opinion.

(By the way, a user does not close a form, that is done by your program)

Just my 2 cents

Cor
Nov 21 '05 #5
Tnx Imran,Cor

I will use the booleans. You are right!

"rob willaar" <lw****@xs4all. nl> schreef in bericht
news:41******** *************** @news.xs4all.nl ...
Hi,

How can i check is a form is disposed in framework 1.1
In framework 2.0 i can check Form.IsDisposed to check if a user closed the
form

Nov 21 '05 #6

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

Similar topics

2
1836
by: Axel Foley | last post by:
Hi Folks, i'm newbie at JS; but "learning by tweaking" is my middle name! Trying to set up a link partnership application on a client's site; got this script at "The Javascript Source", but it does not work for me. If anyone would be so kind as to comb it for apparent flaws, I would be greatly indebted! My <form> statement includes the...
3
1766
by: wj | last post by:
Hi all, Im trying to, deal with a problem that drives me crazy! Im useing the following code to chech the fields of a form before really submitting them: ------- <script language="JAVASCRIPT">
2
5332
by: Dknight | last post by:
Hi, all! I have a problem, how can I check a form data before sending it to server. I have the example below, but first data is sent to server, but after JavaScript checks the data :( I need that JavaSctipt check data and after send it to the server, how can do that? Example: ....
2
1484
by: magister | last post by:
Hello, I have a asp.net page with a form with 15 textboxes and a couple of dropdownlists....I want to know if their is a way (...serverside please...) of checking if any change has been made to any of these controls before I send and update to the database....I would rather not have a OnTextChanged & OnSelectedItemChanged with postback set to...
2
1647
by: Assimalyst | last post by:
Hi, I have a javascript that checks a form for changes, if it has any it alerts the user before they navigate away from the page. it can be disabled on a submit button click by adding onclick="Javascript:bSubmitted=true;" to it's tag.
7
5222
by: Boni | last post by:
Dear all, if I do myform.close() is it disposed or not? is it correct do following? myForm.close() Info=SomeControlOntheForm.text This seems to work. But am not sure that it is waterproof. Thanks, Boni
1
1584
by: Yammaski | last post by:
Hi In this code the field must have at least 3 characters : (var minLength = 3;) Code: // check for Voornaam if (document.Registreren.Voornaam.value.length < minLength) { alert('You have to fill in at least 3 characters'); return false; }
1
9840
by: stevencarroll19 | last post by:
What i wnat to do is check to see if a form is open before a new record can be entered. If any of the forms are open ( Question3 Reason, Question 4 Reason and Question 9 Comments) I want an error message to be displayed saying something along the lines of 'Sorry you have 'form name here' open. Please click save on the form before continuing'...
2
3661
by: dancerman | last post by:
I want a simple as possible regex to check the format of my form submission URL string, I don't care whether is an actual real working URL, just that it be in proper URL format and, IF POSSIBLE add someting so that the URL characters are the only charactrers entered in the field: so it would be an err msg prompt for legit users to enter their...
0
7915
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...
0
7841
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...
0
8339
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...
1
7965
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...
0
8220
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...
0
6617
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...
0
5392
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...
0
3838
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...
1
2345
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

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.