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

Parent Window

i Want to set Color Back ground for a
Application Mdi Window (parent)

i set the form.IsMdiContainer=true;

and i can't Change colors of the main window
is there a way to do this

Thanks
Dave
Sep 19 '08 #1
1 1445
Nevermind got it working
thanks below code to color and draw center text
and footer text

private void ShellWindow_Paint(object sender, PaintEventArgs e)
{

MdiClient oWin = null;
// get the midi frame control
for (int tt = 0; tt < this.Controls.Count; tt++)
{
if (this.Controls[tt] is MdiClient)
{
oWin = (MdiClient)this.Controls[tt];
// break;
}

}
Graphics oGraphics = oWin.CreateGraphics();

oWin.BackColor = System.Drawing.Color.Blue ; //.RoyalBlue;
//.FromArgb(35,7,143); //.Brushes.AliceBlue;
oWin.Refresh();
// Create string to draw.
//e.MeasureString(drawString, this.Font);
// Create font and brush.
Font oFont = new System.Drawing.Font("Arial Wide", 30,
FontStyle.Bold | FontStyle.Italic);
System.Drawing.SizeF TxtSize = oGraphics.MeasureString(Header,
oFont);
SolidBrush GreyBrush = new
SolidBrush(System.Drawing.Color.Black);
SolidBrush BlackBrush = new
SolidBrush(System.Drawing.Color.White);
// Create point for upper-left corner of drawing.
//x=widht
//y=height

float x = (this.ClientSize.Width / 2) - (TxtSize.Width / 2);
float y = (this.ClientSize.Height / 2) - (TxtSize.Height / 2);
// Set format of string.
StringFormat drawFormat = new StringFormat();
drawFormat.FormatFlags =
StringFormatFlags.MeasureTrailingSpaces;
//draw Shadow
oGraphics.DrawString(Header, oFont, GreyBrush, x + 3, y + 3,
drawFormat);
// Draw string to screen.

oGraphics.DrawString(Header, oFont, BlackBrush, x, y,
drawFormat);
//draw Owner Notice bottom Right

oFont = new Font("Arial Wide", 10, FontStyle.Bold |
FontStyle.Underline); // FontStyle.Underline);
TxtSize = oGraphics.MeasureString(Footer, oFont);
oGraphics.DrawString(Footer, oFont, BlackBrush,
oWin.ClientSize.Width - TxtSize.Width,
oWin.ClientSize.Height
- TxtSize.Height, drawFormat);
}
private void Form1_Resize(object sender, EventArgs e)
{
//force a Repaint for color and Text to be re aligned
this.Invalidate();
}


"DaveL" <dv*****@sbcglobal.netwrote in message
news:Z1***************@flpi150.ffdc.sbc.com...
>i Want to set Color Back ground for a
Application Mdi Window (parent)

i set the form.IsMdiContainer=true;

and i can't Change colors of the main window
is there a way to do this

Thanks
Dave


Sep 19 '08 #2

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

Similar topics

1
by: Filiz Duman | last post by:
Is it possible to call a javascript function based in the parent window from the child window ? I do open a pop up window from the parent window with: newwindow = window.open (...) and assign...
4
by: Davey | last post by:
I have a website which has a popup window (this only opens when the user chooses to open it). In the popup window I have a <select> control which lists a selection of "classes". Each class has a...
2
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...
2
by: Jeronimo Bertran | last post by:
Hi, I have a page with a very data intensive grid which needs to be automatically refreshed constantly if a change is detected. In order to not refresh the complete page so often, I created an...
1
by: Earl Teigrob | last post by:
I did a ton of searching to try and find a simple solution to this issue and finally wrote my own, which I am sharing with everyone. In my searching, I did find a very complete and robust solution at...
5
by: Peter | last post by:
1) I have a C# web application and what I am trying to do is create a popup window from a link on the parent window 2) the popup window will have a button and when a user clicks on the button the...
6
by: paul | last post by:
HI! How do we send a variable from an Iframe page back to its parent? I have a script that calculates the iframe's window size but I need to know how to send that value back to its parent so I...
4
by: Phil Powell | last post by:
I thought this would work but it seems to not work neither in Netscape nor in IE: <script type="text/javascript"> <!-- // OBTAINED FROM http://www.javascripter.net/faq/settinga.htm //...
2
by: Robert Degen | last post by:
Hello, I got a little problem. Seems very simple: * I want to open a popup window * Popup-window uses data from its father window. BUT a parent.window does NOT point to the real parents...
2
by: epaetz | last post by:
Is there a way to decouple the linkage between a parent and a child window? Does the parent window have any sort of a collection that holds all the children that it has spawned? I want to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.