在VB.NET中,加载事件后如何使用.NET进行操作?

2026-05-06 10:251阅读0评论SEO资讯
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计276个文字,预计阅读时间需要2分钟。

在VB.NET中,加载事件后如何使用.NET进行操作?

我需要一些方法来理解表单何时完成加载。我的情况是,我有一个加载此表单的第二个表单。在form1.load调用此代码时,Form2当前正显示在form1后面。因为我猜测form1加载结束后调用act。

我需要一些方法来了解表单何时完成加载.我的理由是我有一个加载此表单时加载的第二个表单.从form1.load调用此代码.

Form2当前正在form1后面显示,因为我猜测form1在加载结束时调用了activate或类似的东西,因此覆盖了form2上的任何Activate,BringToFront等调用.

如果你查看下面的代码,我已经尝试在调用ShowAlloactionSearchDialog()之后添加frmAllocationSearch.Activate,frmAllocationSearch.BringToFront和Me.SendToBack,但这些都被浪费了,因为在load事件被触发之后发生了一些事情前方.

代码是:

Private Sub Allocation_Load(ByVal sender As Object, ByVal e As System.EventArgs) _ Handles Me.Load ShowAlloactionSearchDialog() End Sub Private Sub ShowAlloactionSearchDialog() If frmAllocationSearch Is Nothing OrElse frmAllocationSearch.IsDisposed Then frmAllocationSearch = New AllocationSearch frmAllocationSearch.MdiParent = Me.MdiParent frmAllocationSearch.Info = Me.Info frmAllocationSearch.Top = Me.Top frmAllocationSearch.Left = Me.Left + Me.Width - frmAllocationSearch.Width frmAllocationSearch.AllocationWindow = Me frmAllocationSearch.Show() Else If frmAllocationSearch.WindowState = FormWindowState.Minimized Then frmAllocationSearch.WindowState = FormWindowState.Normal End IF frmAllocationSearch.Activate() End If End Sub 也许你可以尝试 Form.Activated活动.

Occurs when the form is activated in code or by the user.

在VB.NET中,加载事件后如何使用.NET进行操作?

本文共计276个文字,预计阅读时间需要2分钟。

在VB.NET中,加载事件后如何使用.NET进行操作?

我需要一些方法来理解表单何时完成加载。我的情况是,我有一个加载此表单的第二个表单。在form1.load调用此代码时,Form2当前正显示在form1后面。因为我猜测form1加载结束后调用act。

我需要一些方法来了解表单何时完成加载.我的理由是我有一个加载此表单时加载的第二个表单.从form1.load调用此代码.

Form2当前正在form1后面显示,因为我猜测form1在加载结束时调用了activate或类似的东西,因此覆盖了form2上的任何Activate,BringToFront等调用.

如果你查看下面的代码,我已经尝试在调用ShowAlloactionSearchDialog()之后添加frmAllocationSearch.Activate,frmAllocationSearch.BringToFront和Me.SendToBack,但这些都被浪费了,因为在load事件被触发之后发生了一些事情前方.

代码是:

Private Sub Allocation_Load(ByVal sender As Object, ByVal e As System.EventArgs) _ Handles Me.Load ShowAlloactionSearchDialog() End Sub Private Sub ShowAlloactionSearchDialog() If frmAllocationSearch Is Nothing OrElse frmAllocationSearch.IsDisposed Then frmAllocationSearch = New AllocationSearch frmAllocationSearch.MdiParent = Me.MdiParent frmAllocationSearch.Info = Me.Info frmAllocationSearch.Top = Me.Top frmAllocationSearch.Left = Me.Left + Me.Width - frmAllocationSearch.Width frmAllocationSearch.AllocationWindow = Me frmAllocationSearch.Show() Else If frmAllocationSearch.WindowState = FormWindowState.Minimized Then frmAllocationSearch.WindowState = FormWindowState.Normal End IF frmAllocationSearch.Activate() End If End Sub 也许你可以尝试 Form.Activated活动.

Occurs when the form is activated in code or by the user.

在VB.NET中,加载事件后如何使用.NET进行操作?