473,387 Members | 1,641 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,387 software developers and data experts.

Verify if Form is already open

nTn
Hi!

I open a new form in my Mdi. But if I click in button again to open this
form, the program create another form.

How I can check if the form is already open?

I'm using that:

Dim frmUsuarios As New usuarios("Usuarios", Me)frmUsuarios.Show()
Nov 20 '05 #1
2 1586
Use a shared function to open the form as a singleton then it will only be
created once.

..
"nTn" <br*************@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi!

I open a new form in my Mdi. But if I click in button again to open this
form, the program create another form.

How I can check if the form is already open?

I'm using that:

Dim frmUsuarios As New usuarios("Usuarios", Me)frmUsuarios.Show()

Nov 20 '05 #2
Class Form1

Private Shared _Form As Form1

Auto Generated code ......

Public Shared Function SingltonShowForm(ByVal Title As String, ByVal Owner
As Object) As Form1

If _Form Is Nothing OrElse _Form.IsDisposed Then

_Form = New Form1

With _Form

..Text = Title

..Owner = Owner

End With

End If

_Form.Show()

Return _Form

End Function

<Mike> wrote in message news:u1**************@TK2MSFTNGP12.phx.gbl...
Use a shared function to open the form as a singleton then it will only be
created once.

.
"nTn" <br*************@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi!

I open a new form in my Mdi. But if I click in button again to open this
form, the program create another form.

How I can check if the form is already open?

I'm using that:

Dim frmUsuarios As New usuarios("Usuarios", Me)frmUsuarios.Show()


Nov 20 '05 #3

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

Similar topics

3
by: P | last post by:
Hi, Access 2002. I use DoCmd.OpenForm attached to command buttons to open one form from another form. All forms are open in dialog mode. When a user tries to open a form already opened from a...
5
by: smhaig | last post by:
In a vb 6 app in the activate event I was able to do some testing and if something failed, I was able to exit the form and return to the caller form. I have tried everything and searched web but...
9
by: RichG | last post by:
In VB 5 I could have a form named frmTest and open it with frmTest.Show Now in VB.net I have to Dim frm as New frmTest frm.show The problem is I only want one instance of frmTest open, not a...
7
by: anthony.turcotte | last post by:
Hi, I've looked for a solution to this problem on google, read posts in this newsgroup and I still haven't found anything that could help me. Here's the scenario. 1. User accesses...
0
by: jpr | last post by:
Hello, I need some help. I have a form named MASTER based on a table also called MASTER. A control of my form in names SSN which stores the client SSN. On the same form I have placed a subform...
3
by: jpr | last post by:
Hello, I have a form on which I have a cmdbutton to copy a couple of fields into another table (MASTER) using the SSN on the active form as criteria. In the active form (based on a tables...
8
by: SBC News Groups | last post by:
I have a field on a form that when a user enters a number, I want to verify that the number is already in another table. For example: If a user enters 100 in the control Bidder, I want to check...
30
by: diane | last post by:
I've got an application running with table-based security: i capture the user's windows login with fOsusername, then have them enter a password checked against their username/login in my own table....
19
by: =?Utf-8?B?R3JlZw==?= | last post by:
How can I tell via code if a Form is already open. Each time my forms load I have some initialization code that runs, but if the form is already open and hidden I don't want that initialization...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
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...

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.