Do I Find or Write the new Form Events (Activated,DeActivated,Closing,Closed) 
Author Message
 Do I Find or Write the new Form Events (Activated,DeActivated,Closing,Closed)

In VB6, all the Form Events were in the dropdown   In VB.NET,  all the
events are not in the drop down.  Form_Load appears in the inital form code.

When I try to add "Private Sub Form_Closing(byVal sender as
System.Object,byVal e as System.EventArs) Handles MyBase.Closing" to the
code,  I get an error "Can't find an Event Closing that has the same
signature as the handling method."

What should I have done?



Tue, 25 May 2004 20:58:18 GMT  
 Do I Find or Write the new Form Events (Activated,DeActivated,Closing,Closed)
I think, And I am probably wrong, but it looks like you did not have all the
same Byval's that the Proper event has.  I.e. you are missing a ByVal, or
have an Incorrect ByVal.....I ran across something like that a  while back
when I was creating my own event handlers for custom Components.

Cade


Quote:
> In VB6, all the Form Events were in the dropdown   In VB.NET,  all the
> events are not in the drop down.  Form_Load appears in the inital form
code.

> When I try to add "Private Sub Form_Closing(byVal sender as
> System.Object,byVal e as System.EventArs) Handles MyBase.Closing" to the
> code,  I get an error "Can't find an Event Closing that has the same
> signature as the handling method."

> What should I have done?



Tue, 25 May 2004 22:07:22 GMT  
 Do I Find or Write the new Form Events (Activated,DeActivated,Closing,Closed)
The events are in the dropdown.  You need to select "BaseClassEvents" in the
left dropdown.  Then, in the right drop down you can see a list of events.
And, just a note, in the signature of your method, you have "ByVal e As
System.EventArs"  For this particular event, it should be "ByVal e As
CancelEventArgs"

But, the dropdowns will put the signature in the code for you. . .

--
Jacob Grass
Microsoft .NET MVP


Quote:
> In VB6, all the Form Events were in the dropdown   In VB.NET,  all the
> events are not in the drop down.  Form_Load appears in the inital form
code.

> When I try to add "Private Sub Form_Closing(byVal sender as
> System.Object,byVal e as System.EventArs) Handles MyBase.Closing" to the
> code,  I get an error "Can't find an Event Closing that has the same
> signature as the handling method."

> What should I have done?



Tue, 25 May 2004 22:12:03 GMT  
 Do I Find or Write the new Form Events (Activated,DeActivated,Closing,Closed)
thank you both for your help...........


Quote:
> In VB6, all the Form Events were in the dropdown   In VB.NET,  all the
> events are not in the drop down.  Form_Load appears in the inital form
code.

> When I try to add "Private Sub Form_Closing(byVal sender as
> System.Object,byVal e as System.EventArs) Handles MyBase.Closing" to the
> code,  I get an error "Can't find an Event Closing that has the same
> signature as the handling method."

> What should I have done?



Fri, 28 May 2004 19:52:08 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Activate,Deactivate,GotFocus,LostFocus for Forms

2. Activate and Deactivate Form Event not working!

3. Closing down .............................................................................................................

4. manipulate activeDocument.Customproperties in the Close Event

5. Forms, primary thread closing when closing startup form

6. Form Close Button Does Not Close the Form

7. Activate Form / Deactivate Form API Call

8. MDI Forms - Close ALL and mimimize frmChild1 when frmChild2 is activated

9. Form close event occurs before lost focus event

10. Problems Closing a New Window using window.close()

11. Time Delay, close current form, open new form

12. MDIList and Activate Deactivate Events

 

 
Powered by phpBB® Forum Software