开发者

VB Calling Parent form's Methods in a usercontrol

开发者 https://www.devze.com 2023-01-18 04:15 出处:网络
control that contains a button. the user control is placed on my main form. when the button on the user control开发者_Go百科 is clicked I need to to call a method that is located in the mainform.vb Yo

control that contains a button. the user control is placed on my main form. when the button on the user control开发者_Go百科 is clicked I need to to call a method that is located in the mainform.vb


You don't call a method in the parent form, instead you raise an event which the parent form has a handler for. Here is a real simple example of what you do. Here, here and here are a few more related examples.


simply define the method as public and call it from any form...

0

精彩评论

暂无评论...
验证码 换一张
取 消