| | |
How to check if form is open
Thread Solved |
Hi,
Copy this Function and Pass the form name. If form is loaded and not shown, then it's Visible property will be false, u need to check that:
Regards
Veena
Copy this Function and Pass the form name. If form is loaded and not shown, then it's Visible property will be false, u need to check that:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Private Sub CheckFormStatus(Myform As Form) Dim objForm As Form Dim FlgLoaded As Boolean Dim FlgShown As Boolean FlgLoaded = False FlgShown = False For Each objForm In VB.Forms If (Trim(objForm.name) = Trim(Myform.name)) Then FlgLoaded = True If objForm.Visible Then FlgShown = True End If Exit For End If Next MsgBox "Load Status: " & FlgLoaded & vbCrLf & "Show Status:" & FlgShown End Sub
Regards
Veena
•
•
Join Date: Jul 2008
Posts: 4
Reputation:
Solved Threads: 0
Just put the following code in your form closing event (for vb.net (VS2008). For more detail http://developerskb.blogspot.com
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Private Sub frmMain_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing If frmOrdDet.Visible = True Then MsgBox("Costing detail input form is in active! Close it before exit", MsgBoxStyle.Information) frmOrdDet.Focus() e.Cancel = True Else Dim dr As Object If e.CloseReason = CloseReason.UserClosing Then dr = MsgBox("Exit Application..?", MsgBoxStyle.YesNo Or MsgBoxStyle.Question) If dr = vbYes Then frmLogin.Dispose() Me.NotifyIcon.Dispose() e.Cancel = False Else e.Cancel = True End If End If End If End Sub
Last edited by arbalu; Sep 17th, 2008 at 4:36 am.
•
•
Join Date: Mar 2009
Posts: 1
Reputation:
Solved Threads: 0
Thanks ur code worked for me....
•
•
•
•
Hi,
Copy this Function and Pass the form name. If form is loaded and not shown, then it's Visible property will be false, u need to check that:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Private Sub CheckFormStatus(Myform As Form) Dim objForm As Form Dim FlgLoaded As Boolean Dim FlgShown As Boolean FlgLoaded = False FlgShown = False For Each objForm In VB.Forms If (Trim(objForm.name) = Trim(Myform.name)) Then FlgLoaded = True If objForm.Visible Then FlgShown = True End If Exit For End If Next MsgBox "Load Status: " & FlgLoaded & vbCrLf & "Show Status:" & FlgShown End Sub
Regards
Veena
![]() |
Similar Threads
- Updated : Simple ASP.Net Login Page (ASP.NET)
- how to open a pdf file using form in access and creation of browser button (Visual Basic 4 / 5 / 6)
- Open a website using a form (C#)
- By Pressing F3 on MDI Form(Parent) How can a sub menu Form will open (Visual Basic 4 / 5 / 6)
- MDI Child Form Placement (C#)
- Blank Record & Open Form From Datagrid (C#)
- owner form display problem (VB.NET)
- Simple ASP.Net Login Page (Using VB.Net) (ASP.NET)
- Check the code!! (C++)
- Populating & Retrieving Data in a listbox : ASP.NET (w/ VB.NET) (ASP.NET)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Textbox: On Copy... (VBA in AC2003)
- Next Thread: help
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





