2013-05-11 52 views
1

我的MdiParent和许多孩子形成 即时调用子窗体如下的MdiParent,孩子形成

 Private Sub tsmQuotation_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tsmQuotation.Click 
      If Application.OpenForms().OfType(Of Quotation).Any Then 
       Quotation.WindowState = FormWindowState.Normal 
       Quotation.Focus() 
      Else 
       Quotation.MdiParent = Me 
       Quotation.Show() 
      End If 
    End Sub 

我的第一个疑问是:当我宣布这Quotation.MdiParent =我...它需要更多的时间打开表格比没有这一行。我如何减少打开窗体的时间..或者我做错了什么?

第二个疑问是:我有一个picturebox在mdiparent的中心。我已经发送了picturebox回来,但当我打开任何子窗体时,我也看到了quotaion上方的picturebox。我想显示图片框在后面不超过任何儿童形式。

在此先感谢!

回答

1

没有Quotation.MdiParent = Me,显示的表格不会是MdiChild。它将自己显示为正常形式。尝试在屏幕上拖动它,你会发现它并不局限于MdiParent形式。

看是否有此任何更快的加载它,但:

Private Sub tsmQuotation_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tsmQuotation.Click 
    If Application.OpenForms().OfType(Of Quotation).Any Then 
     Dim Q As Quotation = Application.OpenForms().OfType(Of Quotation).First 
     Q.WindowState = FormWindowState.Normal 
     Q.Activate() 
    Else 
     Dim Q As New Quotation 
     Q.MdiParent = Me 
     Q.Show() 
    End If 
End Sub 

对于第二个问题,选择的MdiParent形式和设置的BackgroundImage()和BackgroundImageLayout()的属性。图像不会在设计时显示在表单上,​​但在运行应用程序时它将在那里。

+0

感谢您的回复,解决了第二个问题,但第一个问题仍然存在..这仍然需要时间。 – aj1 2013-05-11 10:40:21

+0

空闲_Mind你可以看看我的另一个问题,因为没有人回复它..http://stackoverflow.com/questions/15619179/crystal-report-layout-designer-in-vb-net-form ..如果没有水晶报告是否有另一个工具,我可以让用户更改报告中控件的布局..我甚至可以为它付钱。因为它对我来说太紧急了。 – aj1 2013-05-11 11:00:30

+0

缓慢加载表单是否加载数据库中的任何数据?...或在Load()或Shown()中有任何重要的代码? – 2013-05-11 12:18:55