日期:2014-05-18  浏览次数:20890 次

Dev控件怎么让Panel里面的窗体随着Panel大小改变?
private void navBarItem1_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
  {
  panelControl1.Controls.Clear();
  QBMRecord qbm = new QBMRecord();
  qbm.TopLevel = false;
  qbm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
  panelControl1.Controls.Add(qbm);
  qbm.Show();
  }
 private void panelControl1_Resize(object sender, EventArgs e)
  {
  QBMRecord qbm = new QBMRecord();
  qbm.Size = this.panelControl1.Size;
  }
我这样做为什么会没用了?
我左边放的是一个navBarControl,右边放一个panel显示我点击navBarControl里面Item时弹出的窗体
因为窗体没有Dock跟Anchor属性,求高手解答。

------解决方案--------------------
private void panelControl1_Resize(object sender, EventArgs e)
{
//这里不应该是new 而是获取已经有的
QBMRecord qbm = new QBMRecord();
qbm.Size = this.panelControl1.Size;
}