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

giving focus back to MDIchild window

Hi,

I have a MDI parent form that opens form as MDIChildren.

I'm trying to check if form is already opened and if it is to give it focus.
I keep getting error messages and no matter what I try it's not sending it
to fornt.

I'm using this code:
Private Sub mnuUserManagement_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles mnuUserManagement.Click

Dim IsMDIExisting As Boolean = False

For Each mdic As Form In Me.MdiChildren

If mdic.Name = "usermanagement" Then IsMDIExisting = True

Next

If IsMDIExisting = False Then

Dim frmUserManagement As New usermanagement

frmUserManagement.MdiParent = Me

frmUserManagement.WindowState = FormWindowState.Maximized

frmUserManagement.Show()

Else

Dim frmUserManagement6 As usermanagement

MessageBox.Show("activateform")

frmUserManagement6.Focus()

End If

End Sub

BTW I know that it finds if it's open because MessageBox pops up.

Thanks in advance,

Vlado

--
Vlado Jasovic
Excelle Technologies Inc.
http://www.excelleinc.com
"single source for all your computer needs"
Nov 21 '05 #1
3 1201
off the top of my head....

Maby you could use:
Me.ActivateMDIChild(frmUserManagement6)

Good Luck
"Vlado J. (www.excelleinc.com)" <vj******@excelleinc.com> wrote in message
news:Sq********************@comcast.com...
Hi,

I have a MDI parent form that opens form as MDIChildren.

I'm trying to check if form is already opened and if it is to give it
focus. I keep getting error messages and no matter what I try it's not
sending it to fornt.

I'm using this code:
Private Sub mnuUserManagement_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles mnuUserManagement.Click

Dim IsMDIExisting As Boolean = False

For Each mdic As Form In Me.MdiChildren

If mdic.Name = "usermanagement" Then IsMDIExisting = True

Next

If IsMDIExisting = False Then

Dim frmUserManagement As New usermanagement

frmUserManagement.MdiParent = Me

frmUserManagement.WindowState = FormWindowState.Maximized

frmUserManagement.Show()

Else

Dim frmUserManagement6 As usermanagement

MessageBox.Show("activateform")

frmUserManagement6.Focus()

End If

End Sub

BTW I know that it finds if it's open because MessageBox pops up.

Thanks in advance,

Vlado

--
Vlado Jasovic
Excelle Technologies Inc.
http://www.excelleinc.com
"single source for all your computer needs"

Nov 21 '05 #2
Didn't help but thanks anyways.
"TCORDON" <tc******@hotmail.com> wrote in message
news:O5**************@TK2MSFTNGP12.phx.gbl...
off the top of my head....

Maby you could use:
Me.ActivateMDIChild(frmUserManagement6)

Good Luck
"Vlado J. (www.excelleinc.com)" <vj******@excelleinc.com> wrote in message
news:Sq********************@comcast.com...
Hi,

I have a MDI parent form that opens form as MDIChildren.

I'm trying to check if form is already opened and if it is to give it
focus. I keep getting error messages and no matter what I try it's not
sending it to fornt.

I'm using this code:
Private Sub mnuUserManagement_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles mnuUserManagement.Click

Dim IsMDIExisting As Boolean = False

For Each mdic As Form In Me.MdiChildren

If mdic.Name = "usermanagement" Then IsMDIExisting = True

Next

If IsMDIExisting = False Then

Dim frmUserManagement As New usermanagement

frmUserManagement.MdiParent = Me

frmUserManagement.WindowState = FormWindowState.Maximized

frmUserManagement.Show()

Else

Dim frmUserManagement6 As usermanagement

MessageBox.Show("activateform")

frmUserManagement6.Focus()

End If

End Sub

BTW I know that it finds if it's open because MessageBox pops up.

Thanks in advance,

Vlado

--
Vlado Jasovic
Excelle Technologies Inc.
http://www.excelleinc.com
"single source for all your computer needs"


Nov 21 '05 #3
What errors are you receiving?

Vlado J. (www.excelleinc.com) wrote:
Hi,

I have a MDI parent form that opens form as MDIChildren.

I'm trying to check if form is already opened and if it is to give it focus.
I keep getting error messages and no matter what I try it's not sending it
to fornt.

I'm using this code:
Private Sub mnuUserManagement_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles mnuUserManagement.Click

Dim IsMDIExisting As Boolean = False

For Each mdic As Form In Me.MdiChildren

If mdic.Name = "usermanagement" Then IsMDIExisting = True

Next

If IsMDIExisting = False Then

Dim frmUserManagement As New usermanagement

frmUserManagement.MdiParent = Me

frmUserManagement.WindowState = FormWindowState.Maximized

frmUserManagement.Show()

Else

Dim frmUserManagement6 As usermanagement

MessageBox.Show("activateform")

frmUserManagement6.Focus()

End If

End Sub

BTW I know that it finds if it's open because MessageBox pops up.

Thanks in advance,

Vlado

Nov 21 '05 #4

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

Similar topics

2
by: Fred Snider | last post by:
Help! Opening a new window using the window.open( ) command works great for opening new windows and having them on top and having the focus. The window.focus command brings any existing...
9
by: Randell D. | last post by:
Folks, I'm working on a contact name/address database whereby a slimed down list is shown in the main window. When a record is selected, the complete record is displayed in a new window via a...
31
by: Benno Bös | last post by:
If I use the following construct in the frame "main" for a link to an extern site: <A HREF="http://www.any.xy" TARGET="extern"> the Browser is creating the window "extern", loading the page...
3
by: Dai Ba Wong | last post by:
Hi: Currently I am having a problem with my webpage. My page consist of two frames, one consist of input text field and the other contains link for different pop-up windows. The problem...
2
by: ungvichian | last post by:
Okay, how do I write a page with a form so that when I click Submit, the following happens? 1. The data is submitted (of course) 2. The form is cleared (what I've tried results in the form being...
0
by: Chris | last post by:
Hi, I have a dilemma. I have a web form that, when submitted, does a window.open js function to submit the form data to a new aspx page which then shows a report. I wanted to make sure that...
13
by: Richard Shewmaker | last post by:
I've only recently returned to (trying to) doing simple JS, so this is probably a really lame question. I have a Web page with a series of graphics in it (window A). Clicking on a graphic in A...
7
by: marty.overdear | last post by:
I am opening a new window using window.open. I need the new window to open on top of the parent everytime. I cannot use onBlur b/c the user will need to click back to the parent for information. ...
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...
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...
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.