我正在尝试将标签从一种形式更新到另一种形式。代码编译正常但没有更新?
Class MainWindow
Private Sub Window_Loaded(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles MyBase.Loaded
Dim frm As New Window1
frm.Show()
End Sub
End Class
第二种形式:
Public Class Window1
Private Sub Button1_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles Button1.Click
My.Windows.MainWindow.Label1.Content = "dsfdsfsdf"
My.Windows.MainWindow.Label1.UpdateLayout()
End Sub
End Class
它不会更新主表单的标签...希望它更清楚