Question regarding MDI

T

Tim Farrell

Hello,

I am VERY new to WindowsForms but VERY eager to learn.

I am in the process of creating an MDI application to manage High Sensitivity Customers within our organization. I am working on the first form which will host the login controls to the application.

I noticed that when I change the type of the form to an isMDIcontainer to TRUE the background color of the application changes to dark grey. No matter what I do I cannot change the background color.

This is really ugly. I even tried a background color however, when I change the controls background to transparent, they are wrapped with that dark grey color instead.

Does anyone have any ideas or resources I can view to rectify my issue?

Thank you very much.

Tim

EggHeadCafe.com - .NET Developer Portal of Choice
http://www.eggheadcafe.com
 
B

Bryan Phillips

The dark grey is the MDIClient control. To set its BackColor at
run-time use code like this:

// Create a new form, make it an MDI container and change the BackColor.
Form f = new Form();
f.IsMdiContainer = true;
f.Controls[0].BackColor = Color.Blue;
f.ShowDialog();


Bryan Phillips
MCSD, MCDBA, MCSE
Blog: http://bphillips76.spaces.live.com
 
G

Garry

Regarding MDI child forms, how do I re-size a loaded child form to
completely fill the ClientRectangle area.

The following code:

frmChild.Top = 0
frmChild.Left = 0
frmChild.Width = Me.ClientRectangle.Width
frmChild.Height = Me.ClientRectangle.Height
frmChild.Show()

displays a child that is TOO big to fit so the client area displays scroll
bars.
Where is there HELP material on the somewhat obscure '.ClientRectangle' -
for the 'Dummy User' of course.
Golly - Microsoft duz obscure things.
In VB6 it woz SO SIMPLE.

Some code examples would be much much appreciated.

Garry



Bryan Phillips said:
The dark grey is the MDIClient control. To set its BackColor at run-time
use code like this:

// Create a new form, make it an MDI container and change the BackColor.
Form f = new Form();
f.IsMdiContainer = true;
f.Controls[0].BackColor = Color.Blue;
f.ShowDialog();


Bryan Phillips
MCSD, MCDBA, MCSE
Blog: http://bphillips76.spaces.live.com




Hello,

I am VERY new to WindowsForms but VERY eager to learn.

I am in the process of creating an MDI application to manage High
Sensitivity Customers within our organization. I am working on the first
form which will host the login controls to the application.

I noticed that when I change the type of the form to an isMDIcontainer to
TRUE the background color of the application changes to dark grey. No
matter what I do I cannot change the background color.

This is really ugly. I even tried a background color however, when I
change the controls background to transparent, they are wrapped with that
dark grey color instead.

Does anyone have any ideas or resources I can view to rectify my issue?

Thank you very much.

Tim

EggHeadCafe.com - .NET Developer Portal of Choice
http://www.eggheadcafe.com
 
B

Bryan Phillips

The ClientRectangle property is just a property that describes the size
of the MDIClient control. You are really manipulating that control when
set the backcolor.

You can maximize the child form by running this code in your mdi form:

Dim frmChild As New Form()
frmChild.MdiParent = Me
frmChild.WindowState = FormWindowState.Maximized
frmChild.Show()


Bryan Phillips
MCSD, MCDBA, MCSE
Blog: http://bphillips76.spaces.live.com




Regarding MDI child forms, how do I re-size a loaded child form to
completely fill the ClientRectangle area.

The following code:

frmChild.Top = 0
frmChild.Left = 0
frmChild.Width = Me.ClientRectangle.Width
frmChild.Height = Me.ClientRectangle.Height
frmChild.Show()

displays a child that is TOO big to fit so the client area displays scroll
bars.
Where is there HELP material on the somewhat obscure '.ClientRectangle' -
for the 'Dummy User' of course.
Golly - Microsoft duz obscure things.
In VB6 it woz SO SIMPLE.

Some code examples would be much much appreciated.

Garry



The dark grey is the MDIClient control. To set its BackColor at run-time
use code like this:

// Create a new form, make it an MDI container and change the BackColor.
Form f = new Form();
f.IsMdiContainer = true;
f.Controls[0].BackColor = Color.Blue;
f.ShowDialog();


Bryan Phillips
MCSD, MCDBA, MCSE
Blog: http://bphillips76.spaces.live.com




"Tim Farrell" <Tim Farrell> wrote in message
Hello,

I am VERY new to WindowsForms but VERY eager to learn.

I am in the process of creating an MDI application to manage High
Sensitivity Customers within our organization. I am working on the first
form which will host the login controls to the application.

I noticed that when I change the type of the form to an isMDIcontainer to
TRUE the background color of the application changes to dark grey. No
matter what I do I cannot change the background color.

This is really ugly. I even tried a background color however, when I
change the controls background to transparent, they are wrapped with that
dark grey color instead.

Does anyone have any ideas or resources I can view to rectify my issue?

Thank you very much.

Tim

EggHeadCafe.com - .NET Developer Portal of Choice
http://www.eggheadcafe.com
 

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

Similar Threads

MDI trouble 2
MDI child forms 1
MDI CONTAINER 2
slow form drawing 3
?? Multiple Selection Colors ?? 2
MDI layout problem 1
Conditional formating problem 3
MDI parent w/ transparent background. possible? 1

Top