MDI Application

G

Guest

Iam using VS.net2005 iwas using 2003
ihave some problem that occuer with me

icreate 2 forms
one is the container of the mdi ,and the onother have textbox in it to
dispaly the files,

i create top-level menue contain --> (File ,edite, windows,.....)

first idont' find property MDILIST to put it to Top-level menue windows ?

second iwant in this menue to tell me the active MDI child to track them and
explain to me how this work?

third how to change any property in the active MDIChild like font or color
of the text in the text box without changing the another child?

thanx all;
 
S

Steve Barnett

Have a look at the MdiWindowListItem property of the MenuStrip. It should
help you out a little.
Steve
 
G

Guest

and how let the toplevel menu tel me which window is active by giving a sign
besdie the window name?
 
G

Guest

idint also get the answer of the another questions?
some one tell me if what i say is clear
 
S

Steve Barnett

Did you try it? If you had, you would see that the framework generates the
support for the window list and handles putting a tick next to the active
window.
 
S

Steve Barnett

When you create a child form, you presumably create an instance of the
"form" so have a reference to the forms object. You should create properties
in your form that can be set from the MDI parent that change the font (or
other) properties. For example...

frmView fView = new frmView(); // Create an instance
of my child form
fView.MdiParent = this; // Set it's
MDI parent
fView.ModelFileName = fOpen.FullName; // Set some attributes on my
form
fView.Show(); // Show
my form

The attributes can be whatever you want them to be, including fonts and
colours.

Alternatively, have menu options on the child form (these get merged with
the MDI parent at run time) for changing the properties of the specific
instance of the child form.
 
G

Guest

Thank u u relly help me with this .
you tell me waht iwant exactly .
but another question that i want to change the property of the active
mdichild.
not the general instance .so we this option can be very usufull.
 
S

Steve Barnett

The mdi parent form has an event that you can capture "mdiChildActivate"
that you can handle to keep track of which child form is currently active
(it's also called when the child is closed).

Also, the mdiParent has a property called ActiveMdiChild which gives you a
reference to the active mdi child form.

Once you have a reference to the active child, you can call methods against
that form or set properties to achieve what you need. Anything you do to an
individual instance will only apply to that instance, so no other mdi child
will change.

If you did eventually want to change all forms, the mdiParent has a
collection called mdiChildren that allows you to access every child form.

Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top