Re: WithEvents keyword gone!

From: Lloyd Sheen (sqlguyremoveallofthis_at_tostopspamhotmail.com)
Date: 04/01/04


Date: Thu, 01 Apr 2004 16:57:48 GMT

I think this is a get out of the car and get back in. Did you at any time
have a control with the name WButton1. I have seen on several occcasions
the remnants of old controls sticking around. Had to stop VS and restart.

Lloyd Sheen

"John" <anonymous@discussions.microsoft.com> wrote in message
news:CA035633-06EF-4157-828A-31896F332AE7@microsoft.com...
> I really stuck!
> I put the declaration " Friend WithEvents WButton1 As WButton " out side
" Windows Form Designer generated code " Region, It works for the first
time. If I switch to Form Design View, and double click on the WButton1, the
Form Designer automatically removes WithEvents keyword, and it also removes
the " Handles WButton1.Click " after the event handler. The original code
look like this:
> Private Sub WButton1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
> and form designer generates the following code:
> Private Sub WButton1_Click_1(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles WButton1.Click
> and an error says Handles clause requires a WithEvents variable, since it
takes that keyword away!
> Don't you think that's stupid? I really need all your HELP! With many
thanks!