当 MultiView Active View 更改时更新标签上的数据绑定值?

发布于 2025-01-07 20:19:12 字数 514 浏览 0 评论 0原文

我有一个多视图,其中有多个视图。当 ActiveView 更改时,我想有选择地对其中一个视图中的标签进行数据绑定。理想情况下,我不想每次 ActiveView 更改时都执行此操作,而仅当它实际上是包含活动标签的视图时才执行此操作。我尝试了这样的操作:

Private Sub MultiView1_ActiveViewChanged(sender as Object, e as System.EventArgs) Handles MultiView1.ActiveViewChanged
   Dim varView as String = MultiView1.GetActiveView.ToString
   If varView = "vwExisting" Then
      ' Code to update label here with latest databind.
   End If
End Sub

现在,MultiView1.GetActiveView.ToString 没有返回我正在寻找的值,有谁知道会发生什么?

I have a MultiView with several Views within it. When the ActiveView changes I want to selectively databind a label that is in one of the views. Ideally, I don't want to do it every time the ActiveView changes, rather only when it is actually the view containing the label that is active. I tried something like this:

Private Sub MultiView1_ActiveViewChanged(sender as Object, e as System.EventArgs) Handles MultiView1.ActiveViewChanged
   Dim varView as String = MultiView1.GetActiveView.ToString
   If varView = "vwExisting" Then
      ' Code to update label here with latest databind.
   End If
End Sub

Now, MultiView1.GetActiveView.ToString doesn't return the value I'm looking for, does anyone know what will?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

双马尾 2025-01-14 20:19:12

GetActiveView 方法返回一个视图类,而不是一个字符串。试试这个...

If MultiView1.GetActiveView.ID = "vwExisting" Then

End If

The GetActiveView Method returns a View Class, not a string. Try this...

If MultiView1.GetActiveView.ID = "vwExisting" Then

End If
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文