473,729 Members | 2,348 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MDI Parent Forms

Hello all
I have a MDI Parent Form with some childs.
I need to know how can I setup a child form in order to disable access for
other forms "in the back".
I need that only the active form be available until the user closes it.

Thanks a lot.
henpat
Dec 6 '06 #1
4 1947

henpat wrote:
Hello all
I have a MDI Parent Form with some childs.
I need to know how can I setup a child form in order to disable access for
other forms "in the back".
I need that only the active form be available until the user closes it.

Thanks a lot.
henpat
You could use ShowDialog:

MyModalForm.Sho wDialog(MyMDIPa rentForm)

The modal form won't be a true MDI child (I don't think, but I've never
properly checked), but it works fine for me in similar situations, and
it still makes the MDI parent form the owner of the modal form.

Dec 6 '06 #2
Thanks a lot.
It Works.

<lo*********@gm ail.comescribió en el mensaje
news:11******** **************@ 16g2000cwy.goog legroups.com...
>
henpat wrote:
>Hello all
I have a MDI Parent Form with some childs.
I need to know how can I setup a child form in order to disable access
for
other forms "in the back".
I need that only the active form be available until the user closes it.

Thanks a lot.
henpat

You could use ShowDialog:

MyModalForm.Sho wDialog(MyMDIPa rentForm)

The modal form won't be a true MDI child (I don't think, but I've never
properly checked), but it works fine for me in similar situations, and
it still makes the MDI parent form the owner of the modal form.

Dec 7 '06 #3
Hi,

I tried this as I would like something similar in my program under certain
circumstances, but if I set the MDIParent property of the child form to my
MDI form, when I call ShowDialog(MDIF orm) I get an error:
----------------------------------------------------------------------------
Form that is not a top-level form cannot be displayed as a modal dialog box.
Remove the form from any parent form before calling showDialog.
----------------------------------------------------------------------------

If I do not set the MDIParent property then the modal form isn't contained
within the MDI form and that rather defeats the object of using an MDI
container form.

Have I missed something obvious or is this what you mean by 'The modal form
won't be a true MDI child '?

Thanks,

Martin.

<lo*********@gm ail.comwrote in message
news:11******** **************@ 16g2000cwy.goog legroups.com...
>
henpat wrote:
>Hello all
I have a MDI Parent Form with some childs.
I need to know how can I setup a child form in order to disable access
for
other forms "in the back".
I need that only the active form be available until the user closes it.

Thanks a lot.
henpat

You could use ShowDialog:

MyModalForm.Sho wDialog(MyMDIPa rentForm)

The modal form won't be a true MDI child (I don't think, but I've never
properly checked), but it works fine for me in similar situations, and
it still makes the MDI parent form the owner of the modal form.

Dec 7 '06 #4

Martin wrote:
Hi,

I tried this as I would like something similar in my program under certain
circumstances, but if I set the MDIParent property of the child form to my
MDI form, when I call ShowDialog(MDIF orm) I get an error:
----------------------------------------------------------------------------
Form that is not a top-level form cannot be displayed as a modal dialog box.
Remove the form from any parent form before calling showDialog.
----------------------------------------------------------------------------

If I do not set the MDIParent property then the modal form isn't contained
within the MDI form and that rather defeats the object of using an MDI
container form.

Have I missed something obvious or is this what you mean by 'The modal form
won't be a true MDI child '?

Thanks,

Martin.
I don't have the code in front of me, but when I don't think I set a
MDIParent for the modal dialogue. I think I just set the MDIParent as
the Owner of the form, but did not set it as the MDIParent. So yeah , I
guess the modal form won't be a "true MDIChild" form. For me this
kludge works fine. If you can get the child form to be a True MDIChild
AND modal, I'd be interested to know how. ;)

Dec 7 '06 #5

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

Similar topics

11
41205
by: HolaGoogle | last post by:
Hi, Sorrryy to ask such basic question but i do need your help! Here's what i'm trying to do: In my parent form i'm calling a my Iframe form to get certain value, then depending on that value enable or disable my submit button in my parent form without using any refresh/reload or submit button in my form. Looks realy simple but i don't know how to get it work. actualy, i've been able to populate listbox,text boxes in my parent with...
25
6208
by: Steve Jorgensen | last post by:
Yup, Steve's full of tips, but hey, it makes him feel important, right? Ok, here goes. I've been trying to improve encapsulation by putting code in the same object as the stuff it affects, so I rarely refer to a subform ir parent form's controls or records from the other form. Instead, I call a procedure in that form that does the job. That's all fine and good, and nothing at all revolutionary, but it leaves one with an annoying...
13
7409
by: Stuart McGraw | last post by:
I haven't been able to figure this out and would appreciate some help... I have two tables, both with autonumber primary keys, and linked in a conventional master-child relationship. I've created forms for both those tables, and inserted the child table form into the master table form as a subform. It works just as it is supposed to, in that I can create a new master record, and then add detail records.
3
11877
by: David N | last post by:
Hi All, I just wonder if in C#, I can develop a user defined control that can call its parent function which is not yet developed. For example, how do I make my user control call a to-be-developed-function cmdOkay_Click() function as described below. 1. Create an user control that contains an OK button as below Public Class MyButton:System.Windows.Form.UserControl
6
6222
by: Claus Holm | last post by:
I'm trying to enable a menuitem in the parent form from a mdichild. Rather than making the menuitems public, I'd go for a public method in the parent form to do the change, but when I call the method from the mdichild, I get this error: C:\MyProjects\Visual Studio Projects\Tournament\Forms\frmLogin.cs(69): The name 'test' does not exist in the class or namespace 'Tournament.frmLogin' frmLogin is the mdichild.
3
9701
by: Maheshkumar.R | last post by:
Hi groups, How i can command over the MDI CHIlD forms created dynamically at runtime from PARENT. Let say, i have generated 5 mdichild forms, but i want to work with child form1 from MDI parent menu functions. if i select draw line in MDI parent, the line should be drawn in current active child..any URLS for this or guide me to achieve this communication... -- Mähésh Kumär. R
2
3442
by: Jim Shank | last post by:
I am really trying to find the best OOP way of doing this. I have a parent MDI form with multiple children and I am trying to communicate variables between them. I have been able to successfully get the parent form to read the child variable by using a Public Property in one of my child forms like such: Public ReadOnly Property ID() As String Get Return strID End Get
6
9423
by: Edwinah63 | last post by:
Hi everyone, could someone give me some thoughts on the best way to manage mdi parent and child forms? in vb6 i could scroll through the forms collection and determine which forms were open/closed and their current state. now i can't. before i didn't have to declare numerous named instances each time i loaded or unloaded a form.
10
4025
by: Charles Law | last post by:
For some reason, when I click the X to close my MDI parent form, the action appears to be re-directed to one of the MDI child forms, and the parent remains open. I am then unable to close the application. What should happen, is that the main MDI form should close, taking the child forms with it. There is code to loop through the child forms, remove the controls on each of them, and then close the form, but this code should execute only...
1
4029
by: nupuragr82 | last post by:
I have a parent form and on button click I am calling a child page where i have a textbox and a button. On button click of child form I am passing the value of the Textbox to the Textbox in parent page and now I want to fire an event. Button click event on parent page- parameter is txtBlank (TextBox in parent page) function SetRange(Src) { window.open("SetRange.aspx?src=" + Src, "_blank", "status = 1, ontop=true, height=110,...
0
8917
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
9426
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...
0
9281
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9200
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
8148
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
6722
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...
1
3238
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
2
2680
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2163
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.