Panel的Dock设置了Fill吗?你放picturebox是不是想设置MDI主窗体的背景图片?
如果想设置MDI主窗体的背景图片,大可设置FORM的Image属性。我试过在MDI主窗体上放Panel,然后把DOCK设置为除Fill之外的几个值,都不会出现挡住MDI子窗体的情况。
如果想设置MDI主窗体的背景图片,大可设置FORM的Image属性。我试过在MDI主窗体上放Panel,然后把DOCK设置为除Fill之外的几个值,都不会出现挡住MDI子窗体的情况。
我主要是通过背景,要实现一些功能..所有放了个Panle.
看看是不是将panle放在最上层了,如果不想放在最上层,你可以选中这个panle,右键,让他置于最底层.这样就可以了.
谢谢...我试过了.单还是没用...SHOW出来的子窗体还是被档着.
是要实现什么功能呢,可以说详细点吗
我在Panle里放了好多picturebox..通过点击实现如 子窗体的加载啊..什么的.
但是现在就是那个PANLE挡住了窗体....
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;namespace test111
{
public partial class Form1 : Form
{
public static int tag1=0;
public Form1()
{
InitializeComponent();
} private void toolStripButton1_Click(object sender, EventArgs e)
{
Form2 f2=new Form2(this.panel1);
f2.MdiParent = this;
f2.MdiParent.LayoutMdi(MdiLayout.TileHorizontal);
f2.Show();
} private void panel1_Paint(object sender, PaintEventArgs e)
{ }
}
}from2的内容
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;namespace test111
{
public partial class Form2 : Form
{
public int tag = 0;
public Panel pan1 = null;
public Form2()
{
InitializeComponent();
}
public Form2(Panel pan1)
{
this.pan1 = pan1;
InitializeComponent();
} private void Form2_Load(object sender, EventArgs e)
{
tag++;
this.pan1.Visible = false;
} private void Form2_FormClosed(object sender, FormClosedEventArgs e)
{
tag--;
if (tag == 0)
{
this.pan1.Visible = true;
}
}
}
}
这样就可以解决有窗口的时候不显示背景,没窗口显示背景