473,624 Members | 2,637 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Bring Parent to Front (on top of modaless child)

I have a form that shows another child form using the Show()
operation. Since the child is modaless, I would like the option that
when I click anywhere on the parent form that the parent form comes in
front of the child. I added a callback in the parent form to call
BringToFront() when I selected anywhere in the parent form, but it
didn't work. Is there an option that I can specify in the child form
to allow for this behavior?
Jul 17 '08 #1
3 3696
O.B. skrev:
I have a form that shows another child form using the Show()
operation. Since the child is modaless, I would like the option that
when I click anywhere on the parent form that the parent form comes in
front of the child. I added a callback in the parent form to call
BringToFront() when I selected anywhere in the parent form, but it
didn't work. Is there an option that I can specify in the child form
to allow for this behavior?
Your button-click or whatever event that caused your parent form to open
the child form has not yet returned (i.e. your parent form is busy) and
cannot serve any more events.

If you want your parent form to continue operate independent of your
child form the child form has to be activated as a separate thread.

--
Bjørn Brox
Jul 17 '08 #2
On Jul 17, 12:04 pm, Bjørn Brox <bpb...@gmail.c omwrote:
O.B. skrev:
I have a form that shows another child form using the Show()
operation. Since the child is modaless, I would like the option that
when I click anywhere on the parent form that the parent form comes in
front of the child. I added a callback in the parent form to call
BringToFront() when I selected anywhere in the parent form, but it
didn't work. Is there an option that I can specify in the child form
to allow for this behavior?

Your button-click or whatever event that caused your parent form to open
the child form has not yet returned (i.e. your parent form is busy) and
cannot serve any more events.

If you want your parent form to continue operate independent of your
child form the child form has to be activated as a separate thread.

--
Bjørn Brox
As noted in the initial post, the child was opened with SHOW ... NOT
ShowDialog. Events in the Parent window are being handled just fine.
Try again ...
Jul 17 '08 #3
On Jul 17, 1:20 pm, "O.B." <funkj...@bells outh.netwrote:
On Jul 17, 12:04 pm, Bjørn Brox <bpb...@gmail.c omwrote:
O.B. skrev:
I have a form that shows another child form using the Show()
operation. Since the child is modaless, I would like the option that
when I click anywhere on the parent form that the parent form comes in
front of the child. I added a callback in the parent form to call
BringToFront() when I selected anywhere in the parent form, but it
didn't work. Is there an option that I can specify in the child form
to allow for this behavior?
Your button-click or whatever event that caused your parent form to open
the child form has not yet returned (i.e. your parent form is busy) and
cannot serve any more events.
If you want your parent form to continue operate independent of your
child form the child form has to be activated as a separate thread.
--
Bjørn Brox

As noted in the initial post, the child was opened with SHOW ... NOT
ShowDialog. Events in the Parent window are being handled just fine.
Try again ...
OK. Figured it out ... the trick is to not specify the Parent form as
the child's "Owner."
Jul 17 '08 #4

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

Similar topics

3
3941
by: Omar Llanos | last post by:
I have Form1 and Form2 (which is inherited from Form1), and I created a button in Form2 that will fill up a textbox in Form1. What code would do that? I tried the simplest way: //from child form in button2 clicked event: textbox1.Text = "Hello";
8
3754
by: Waleed Seada | last post by:
Hi all What need to be done to get the MDI parent call his MDI children Events, methods Thanks in advance /WS
2
23492
by: Raj | last post by:
Hi All, I have a problem with trying to refresh the parent window from child window in order to update data in the parent window. The sequence of events are 1) I click a button in the parent window to open a child window thru javascript window.open 2) I have some functionality in the child window that changes the data
0
1946
by: ACaunter | last post by:
HI there.. I have a dropdown menu for my asp.net website (not a combo box with the down arrow).. its for Home, Compant, ... , Contact Us... and then when the mouse goes over it, the sub menus are displayed for each one... Those sub menus are written as tables.. The menu i can set to Bring to front before i run the program.. which is fine.. but when the sub menus come out.. then are at the back, so i can't see them.. How can i bring them...
1
2390
by: Michael | last post by:
Hi Everyone, I seem to be having a problem accessing a menuitem on the MDIParent from a child form. From a login (frmSecurity -child form) screen, I need to hide a menuitem based on the users role. The problem is that I can't seem to get access to the menuitem. I can't get it with code like: MDIParent.mnuAdministrator.Visible = true MDIParent is the name of the form I gave. This is also the Startup form (in the project settings) if this...
5
24890
by: Iain Bishop | last post by:
I have a simple form with 4 command buttons and 1 label. The label is sometimes visible and sometimes not. When it is visible I want it to be in front of the buttons. I've tried bringing the label to the front and sending the buttons to the back. In design view the form looks fine, but whenever I open the form the label is behind the buttons. Has anyone else experienced this and know the solution? Is this a known fault? I wouldn't think...
1
5679
by: Eric | last post by:
I want to call a method on the MDI parent from the child. Basically the method will set some text (message) on a status strip and show the appropriate icon (for the type of message). I'd also like to put a progress bar on the MDI parent and activate/manipulate it by the child What's the best way to do this? TIA
1
2602
by: bhargavi ramineni | last post by:
I have used the following javascript code to get a child window for parent window. childWin =window.open(url,"window","top=250,left=250,height=100,width=480,status=no,toolbar=no,menubar=no,location=no"); As the child window is not a modal dialog, user can minimize the window and do other actions in parent window. Please help me to avoid that. Even if the child window is minimized, when user tries to do some action in parent window, ...
7
5315
by: markrandolph | last post by:
I have parent.htm and child.htm ================================================================= In parent.htm we have: var parentarray = new Array(5) window.open("child.htm",.....) ================================================================= In child.htm I want to add new elements to parentarray, like opener.parentarray = .......
0
8251
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8688
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8352
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7178
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6115
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5570
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2614
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 we have to send another system
1
1800
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1496
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.