假设你的MDI主窗体是Form2,那么在MDI主窗体上加一隐藏的pictureBox,设它的Image
在窗体构造函数上加上这些
public Form2()
{
InitializeComponent(); foreach (Control con in this.Controls)
{
if(con is MdiClient)
{ con.BackgroundImage=this.pictureBox1.Image;
}
}
}
在窗体构造函数上加上这些
public Form2()
{
InitializeComponent(); foreach (Control con in this.Controls)
{
if(con is MdiClient)
{ con.BackgroundImage=this.pictureBox1.Image;
}
}
}
解决方案 »
- Excel导入数据库,第一行是备注行,第二行才是列名行,怎么忽略第一行?
- Winform连接数据库的问题··哭求援助
- 两个窗体之间如何传递数值呢?
- 怎么去除html标签(61分)
- 四维数组使用中的一个疑惑!
- 从流中获取数据构成图片时(Imange.fromSteam(stream s))发生GDI+一般性错误,请高手解决
- 200分求:我有一个string 变量,包括中文和英文,如何正确的写入一个 txt文件,即如何形成一个正确的FileStream对象
- 怎么为动态控件创建事件
- 函数调用怎么区分?
- TreeView控件编程遇到的重大难题?
- 急!急!急!求C#中判断一个点是否在一个多边形内的函数
- 怎样得到一个字符串中指定字符的个数,谢谢!
Image MainWinImage;
AppPathStr = Split(System.Windows.Forms.Application.ExecutablePath, "\");
try {
this.BackgroundImage = MainWinImage.FromFile(System.Windows.Forms.Application.ExecutablePath.Substring(0, System.Windows.Forms.Application.ExecutablePath.Length - Len(AppPathStr(AppPathStr.Length - 1)) - 1) + "\jpg\background.jpg");
}
catch (Exception exc) {
MsgBox("载入主窗口图片失败", MsgBoxStyle.Information);
}
zhanglizhao(醉猫) 的方法有问题,这种方法对MDI窗体没有效果的