如何实现mdi窗口中显示图片上部居中
时间:2011-01-26 来源:cwf软件开发平台
MdiClient不支持添加图片框控件
添加到mdi窗口中,就会在所有的子窗口的上面
try
{
if (System.IO.File.Exists(System.IO.Path.Combine(System.IO.Path.GetTempPath(), "wfp_form_adv.jpg")))
{
byte[] mybyte = System.IO.File.ReadAllBytes(System.IO.Path.Combine(System.IO.Path.GetTempPath(), "wfp_form_adv.jpg"));
this.BackgroundImage = Image.FromStream(new MemoryStream(mybyte));
// this.BeginInvoke(new EventHandler(movePic), mybyte);
}
}
catch { }
private void movePic(object sender, EventArgs e)
{
mypic.Image = Image.FromStream(new MemoryStream((byte[])(sender)));
mypic.Left = (this.Width - mypic.Width) / 2;
}
PictureBox mypic = new PictureBox();
mypic.SizeMode = PictureBoxSizeMode.AutoSize;
mypic.Top = 0;
mypic.SendToBack();
this.Controls.Add(mypic);
可以显示图片,但是这个方案还是不行!