如何从单独的模块引用表单控件 [英] How do I reference a form control from a separate module
本文介绍了如何从单独的模块引用表单控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个UserControl
< UserControl x:名称 = MainForm x:Class = Docker
...
< CheckBox x:名称 = cGroups 内容 = 在方组 / >
...
< span class =code-keyword>< / UserControl >
和一个名为MainModule.vb的单独模块在同一个项目中。
在UserControl表单上有一个名为'cGroups'的复选框,我需要从MainModule引用它来获取它的值。
如何解决这个问题?
解决方案
我建议你阅读:
试一试:创建自定义WPF控件 [ ^ ]
在UserControl中公开控件的属性 [ ^ ]
创建WPF自定义控件,第2部分 [< a href =http://www.codeproject.com/Articles/49802/Create-a-WPF-Custom-Control-Parttarget =_ blanktitle =New Window> ^ ]
I have a UserControl
<UserControl x:Name="MainForm" x:Class="Docker"
...
<CheckBox x:Name="cGroups" Content="Inside Groups"/>
...
</UserControl>
and a separate Module called MainModule.vb that is within the same project.
There is a checkbox named 'cGroups' on the UserControl form that I need to reference from MainModule to get it's value.
How would I go about this?
解决方案
I'd suggest to read this:
Try it: Create a custom WPF control[^]
Expose a Property of a Control inside a UserControl[^]
Create a WPF Custom Control, Part 2[^]
这篇关于如何从单独的模块引用表单控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文