VB Calling Parent form's Methods in a usercontrol
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...
精彩评论