vb.net - 在子窗口 VB.NET 2015 中访问 MDI 父 StatusStrip
问题描述
VB.NET 2015 - 在 MDI 窗口中放置了带有 2 个 ToolStripStatusLabel 的 StatusStrip 控件。当我打开一个新表单时,这将是 MDI 窗口的子级。
我如何从信息 ToolStripStatusLabel 中读取信息。
For Each 不会遍历 StatusStrip 中的所有项目,并且据我所知,ToolStripStatusLabel 本身不是一个控件,因此 For each 循环不起作用。
出于与上述相同的原因,Me.Owner.Controls 也无法访问 ToolStripStatusLabel
该怎么办 ?
解决方案
jmcilhinney 的事件方法绝对是一种更好的方法,但是作为一种快速解决方案,My
命名空间可以在 VB.Net 中使用。
My.Forms.<Form Name>.<Control name>.<property>
例如:
My.Forms.AM_MDI.ToolStripStatusLabel1.Text
对于那些喜欢阅读更多关于我的命名空间的人 - VB.NET 中的命名空间 https://www.thoughtco.com/namespaces-in-vbnet-3424445
您在 VB.NET 中使用“我的”命名空间吗? 您在 VB.NET 中使用“我的”命名空间吗?
推荐阅读
- c# - 加解密方法
- python - Azure Python SDK - 使用 cloud-init 启动 VM
- drupal - 试图从drupal gt获取非对象的属性
- python - 找到与文件中的时间戳更接近的时间戳
- microservices - 使用 URL 调用 feign 客户端
- sql - SQL Left Join on Criteria between dates?
- ios - react-native-maps fitToSuppliedMarker/fitToCorodinates 不显示所有标记
- c# - Collectoiview.Filter 不过滤数据
- ios - 如何在 MKMapView Swift 上动画 MKOverlay 的移动
- authentication - Safari 12 和“防止跨站跟踪”模式