473,385 Members | 1,824 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Is form still loaded

I have the following simple piece of code.

How can I test if the form I show is still loaded?

Thanks
Private Sub mnuAnalysisResults_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles mnuAnalysisResults.Click
Dim AFormReport As New frmAnalysisResults
AFormReport.Show()
End Sub
Nov 21 '05 #1
6 937
Jack,

It is in the non simple properties

If not myform.isdisposed then

http://msdn.microsoft.com/library/de...posedtopic.asp

I hope this helps,

Cor
Nov 21 '05 #2
Hi,

I would make AFormReport a form level variable.

Dim AFormReport As New frmAnalysisResults

Private Sub mnuAnalysisResults_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles mnuAnalysisResults.Click
If AFormReport is nothing then
' needs to be reloaded
AFormReport = new frmAnalysisResults
End If

AFormReport.Show()
End Sub

Ken
----------------------
"Jack Russell" <ja***@norubbish.tpg.com.au> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
I have the following simple piece of code.

How can I test if the form I show is still loaded?

Thanks
Private Sub mnuAnalysisResults_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles mnuAnalysisResults.Click
Dim AFormReport As New frmAnalysisResults
AFormReport.Show()
End Sub
Nov 21 '05 #3
Cor Ligthert [MVP] wrote:
Jack,

It is in the non simple properties

If not myform.isdisposed then

http://msdn.microsoft.com/library/de...posedtopic.asp

I hope this helps,

Cor

Cor,
Thanks
This is where I get confused,
I created the form with a local variable
Dim AFormReport As New frmAnalysisResults
AFormReport.Show()
So what do I pass to is disposed.

Jack
Nov 21 '05 #4
Jack,
Dim AFormReport As New frmAnalysisResults
AFormReport.Show()


Now you are sure that the object exist because you created it before the
show as a complete new form.

For what you probably need (the form is than instanced globaly in the class)
see the sample from Ken.

Cor
Nov 21 '05 #5
Cor Ligthert [MVP] wrote:
Jack,

Dim AFormReport As New frmAnalysisResults
AFormReport.Show()

Now you are sure that the object exist because you created it before the
show as a complete new form.

For what you probably need (the form is than instanced globaly in the class)
see the sample from Ken.

Cor

Thanks to you both for your help
Nov 21 '05 #6
Jack,

"Jack Russell" <ja***@norubbish.tpg.com.au> schrieb:
How can I test if the form I show is still loaded?
[...]
Private Sub mnuAnalysisResults_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles mnuAnalysisResults.Click
Dim AFormReport As New frmAnalysisResults
AFormReport.Show()
End Sub


=>

\\\
Private m_ReportForm As ReportForm
..
..
..
If m_ReportForm Is Nothing OrElse m_ReportForm.IsDisposed Then
m_ReportForm = New ReportForm()
m_ReportForm.Show()
Else
m_ReportForm.Activate()
End If
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #7

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

Similar topics

10
by: Dave Karmens | last post by:
If I have say 10 fixed variables, how can I set their values = to that of a form that is built dynamically? column1 column2 email = formvalue(0) fname = formvalue(1) lname = formvalue(2)...
2
by: David N | last post by:
Hi All, The OnLoad() event is invoked automatically when a form is being loaded. Do we have another event that is invoked automatically after a form has completed loading? Thanks.
8
by: CJack | last post by:
hy, I have an mdi application, i create a child form and I want to know when a button is pressed while that child form is loaded. I have this code: private void frmTestBaby_KeyUp(object sender,...
2
by: yxq | last post by:
Hi When a sub-Form are loading, how to know the sub-Form has been loaded to finish(all work end)? I wrote the code ********************************************* Me.Cursor =...
5
by: Engineerik | last post by:
I have a login form which I want to display with the showdialog method. When I do that the event handler for the load event does not run. If I use the show method the load event handler runs...
10
by: B-Dog | last post by:
I want to run something once my form in completely loaded and drawn but running at the end of form load doesn't do I guess cause of the large dataset fill and the form isn't fully loaded. Where...
4
by: Arsalan | last post by:
In MDI interface, suppose i have a form named "FORM" , how do i check if its already loaded or not ??
5
by: Tom | last post by:
I have a main VB.NET application that loads another VB.NET DLL dynamically. Once I have done that, I would like to be able to 'get' the icon of a form in that dynamically loaded DLL. How would...
4
by: ThunderMusic | last post by:
Hi, I have a custom form that works fine when I debug it or run it in release mode but cannot be loaded in the designer... Actually, it can be loaded in the designer when no control is on it, but...
2
by: KC-Mass | last post by:
I have a form that is used to ID and then load Excel files into Access. I use labels on the form to record which file was last loaded. That was accomplished with a simple lblFileLoaded =...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.