Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Raising click event on another form
I'm very new to VB.net and having a lot of trouble raising a click event on another form. I've got two forms (form1 & form2). Form1 has a button that shows (or opens) form2 with the following code:
Dim newform2 As New Form2
Now I have a button on form2 that is supposed to close itself (form2) and raise the click event of button (btnCancel) on form1 that will clear all the textboxes (of form1) and do some other form houskeeping to get form1 back to its original state.
I've tried the folowing code but the "form1.btnCancel" bit produces a "Reference to a non-shared member requires an object refrence" error.
I'm using VB.NET Version 2003 and ANY help will be highly appreciated!
0 · ·