473,387 Members | 1,465 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.

how to stop reopen form which already opened

Hi Friends

how to stop reopen form which already opened.

for example my form code is like this
every time when i click opening the form i want to stop
that please help

M.A.Endran
Private Sub mnuRefSalesEXE_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
mnuRefSalesEXE.Click, mnuMainRefSalesExe.Click

Dim objfrmSalesExe As New frmSalesExe
objfrmSalesExe.Show()

End Sub

Jul 21 '05 #1
2 1974
Try this:

Private objfrmSalesExe As New frmSalesExe

Private Sub mnuRefSalesEXE_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
mnuRefSalesEXE.Click, mnuMainRefSalesExe.Click

objfrmSalesExe.Show()
objfrmSales.Focus()

End Sub

Raul Ropero
www.all-done-com
"endran" <an*******@discussions.microsoft.com> escribió en el mensaje
news:1a*****************************@phx.gbl...
Hi Friends

how to stop reopen form which already opened.

for example my form code is like this
every time when i click opening the form i want to stop
that please help

M.A.Endran
Private Sub mnuRefSalesEXE_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
mnuRefSalesEXE.Click, mnuMainRefSalesExe.Click

Dim objfrmSalesExe As New frmSalesExe
objfrmSalesExe.Show()

End Sub

Jul 21 '05 #2
Here's the code I use when I click on a particular tabpage (I'm embedding
forms in my tab pages):

Private Sub TabPage1_Enter(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles TabPage1.Click
Dim oControl As Control = findControl(sender, GetType(SubForm))
If oControl Is Nothing Then
Dim oSubForm As New SubForm
oSubForm.TopLevel = False
oSubForm.FormBorderStyle = FormBorderStyle.None
oSubForm.Parent = sender
oSubForm.Dock = DockStyle.Fill
oSubForm.Show()
oControl = oSubForm
End If
oControl.Focus()
End Sub

Public Function findControl(ByVal oParent As Control, ByVal oType As
Type) As Control
For Each myControl As Control In oParent.Controls
If myControl.GetType Is oType Then
Return myControl
End If
Next
End Function
"endran" <an*******@discussions.microsoft.com> wrote in message
news:1a*****************************@phx.gbl...
Hi Friends

how to stop reopen form which already opened.

for example my form code is like this
every time when i click opening the form i want to stop
that please help

M.A.Endran
Private Sub mnuRefSalesEXE_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
mnuRefSalesEXE.Click, mnuMainRefSalesExe.Click

Dim objfrmSalesExe As New frmSalesExe
objfrmSalesExe.Show()

End Sub

Jul 21 '05 #3

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

Similar topics

4
by: Tonya | last post by:
Hi, Does anyone have any example of how i can manage forms in my application?? I want to be able to reference my form instances that are currently open from other forms. why cant i open...
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...
3
by: Susan Bricker | last post by:
Greetings. I have three forms that are open at the same time. They are related and cascading. The first form (frmEventAdd) is the anchor. Each event can have many Trials. The second form is...
7
by: VM | last post by:
Hi, Is it possible to open always only one instance of a MDIChild form? Say, if form A is already opened, just give it the focus. I tried declaring theMDIChild forms as private members of the...
2
by: endran | last post by:
Hi Friends how to stop reopen form which already opened. for example my form code is like this every time when i click opening the form i want to stop that please help M.A.Endran Private...
1
by: Amir Steta | last post by:
i am using one aspx.net form to enter data. it is opened as a popup window (lets call it dataentry.aspx) on w=760 and h=400. from this page i allow opening new aspx.net form (searchdata.aspx) to...
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...
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...
1
by: Mohit | last post by:
Hi all, I am working on a windows based client server application with multiple forms. All forms are having custom title bars with no default bars. There is one main form. Some forms are opened up...
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: 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
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.