顧客のリストを含むフォームと、顧客を追加できる別のフォームがあります。fAddCustomer
からフォームを開くと、fCustomerList
次のコードを使用して呼び出しています。
Dim f As New Form
f = New fAddCustomer(con, False)
f.MdiParent = Me.MdiParent
f.Show()
でfCustomerAdd
、私が持っているToolStripButton
顧客を追加します。フォームが閉じUltraWinGrid
られたらfCustomerList
、リストの新しいデータを自動的に表示するために、持っているを更新する必要があります。
私が使用しているのでToolStripButton
、フォームの用途をf.MdiParent = Me.MdiParent
、私はで使用された同じ溶液を使用することはできませんここでは、この答えは何があるとして、DialogResult
上ToolStripButton
、あなたが使用することはできませんShowDialog
使用している場合MdiParents
。
これを達成できる他の方法はありますか?
DataSource
@Plutonix が提案したように、パスを変更せずにこれを達成できるのは、次のようなことをすることです。
Private Sub fAddCustomer_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
Try
If Application.OpenForms.OfType(Of fCustomerList).Any Then
Application.OpenForms("fCustomerList").Close()
Dim f As New fCustomerList()
f.MdiParent = Me.MdiParent
f.Show()
End If
Catch ex As Exception
Debug.WriteLine(ex.Message)
End Try
End Sub
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加