473,473 Members | 1,886 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 1978
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
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...
1
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...
0
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,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.