将设置值传递回调用该表单的表单
这就是我所拥有的..
Dim frmSettings As New frmOptions
frmSettings.ShowDialog(Me)
frmSettings 是一个设置表单,您可以选择 form1(Me) 的背景颜色。但我无法访问 form1 属性来更改背景色。
This is what I have..
Dim frmSettings As New frmOptions
frmSettings.ShowDialog(Me)
frmSettings is a settings form that you can choose the color for background of form1(Me). But I cannot access the form1 properties to change the backcolor.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
但是,您可以在当前表单中提供一个回调,当属性更改时设置表单可以调用该回调,这将为您完成此操作。对不起,C#;对于我来说,早上写 VB 还太早。您可能需要一个接口来定义用于更改属性的方法集并将表单作为接口传递,以便调用者可以访问这些方法。
然后在设置表单
和事件处理程序中
You could, however, provide a callback in the current form that the settings form could call when the property is changed that would do it for you. Sorry for the C#; too early in the AM for me to write VB. You'd probably need to have an interface that defines the set of methods used to change the properties and pass the Form as the interface so that the caller has access to the methods.
Then in your in the settings form
and in your event handler