Handles delegate dropped on control copy/paste

D

Dean Slindee

Just wondering: why the need to drop the Handles delegate clause when a
control that already has event code is cut/pasted in the form designer.

Maybe there's a good reason, but it seems like overkill to me. Why not just
let the delegate remain, and then let it be subject to a syntax error after
a paste (or if the paste does not happen)? If the rest of the code stays,
why not the delegate too?

Thanks for the insight.
Dean Slindee
 
M

Michael C

Dean Slindee said:
Just wondering: why the need to drop the Handles delegate clause when a
control that already has event code is cut/pasted in the form designer.

Maybe there's a good reason, but it seems like overkill to me. Why not
just let the delegate remain, and then let it be subject to a syntax error
after a paste (or if the paste does not happen)? If the rest of the code
stays, why not the delegate too?

Hmmmm, I've been told the handles keyword is superior to the C# method of
attaching to events. Surely there isn't a bug in VB with it :)

Michael
 
C

Cor Ligthert[MVP]

Dean,

You write two things, first copy/paste and then in the message cut/past.

I did not try it, but it has always been that if you copy and paste it, it
is gone (otherwise you would have at two places the same method to handle an
exact equal event).

If you cut and paste it, everything is copied.

Cor
 
C

Cor Ligthert[MVP]

Michael,

Which C# guy told you that the VB methods of handling events is supperior to
C#.

There is no "handles" keyword in C# so there cannot been spoken of
superiority, however simple events are easier to handle in VB then in C#,
while complex handling can be done in the same way in VB like in C#.

You show with your messages a lack knowledge of languages (program and
natural).

See it like this (Michel Posseth has written this too lately). As you look
at natural languages, then from the languages which I know is C# like German
or Polish. VB is more like English (it has by instance more synonyms (this
comes from the many tribes which have invaded England)).

But because of that is English not superior or inferior to German or Polish.

Cor
 
M

Michael C

Cor Ligthert said:
Michael,

Which C# guy told you that the VB methods of handling events is supperior
to C#.

Actually you and others. You've said many times handles is better than +=.
There is no "handles" keyword in C# so there cannot been spoken of
superiority, however simple events are easier to handle in VB then in C#,

Only mildly easier these days.
while complex handling can be done in the same way in VB like in C#.

That's true.
You show with your messages a lack knowledge of languages (program and
natural).

Interesting that you've shown a greater lack of understanding of C# than I
have about VB, although I have learnt of a couple of new limitation of VB in
just the last couple of days.
See it like this (Michel Posseth has written this too lately). As you look
at natural languages, then from the languages which I know is C# like
German or Polish. VB is more like English (it has by instance more
synonyms (this comes from the many tribes which have invaded England)).

But because of that is English not superior or inferior to German or
Polish.

As I've said many times, VB and C# are not so different to compare them to
different spoken languages. They're more like the same language with a
different accent.

Michael
 
M

Mike Williams

As I've said many times, VB and C# are not so different
to compare them to different spoken languages. They're
more like the same language with a different accent.

What a sad end for a once proud and noble language ;-)
 
M

Michael C

Mike Williams said:
What a sad end for a once proud and noble language ;-)

It's actually a really great step for the language. We've got all of the
ease of use of VB6 but with all the cool features that VB6 lacked and most
of the silly limitations removed. Then as a bonus we've got the more
streamlined and simpler syntax of C. If you actually gave it a try mike
you'd wonder why you'd spent 8 years using a dead language.

Michael
 
C

Cor Ligthert[MVP]

Michael,
As I've said many times, VB and C# are not so different to compare them to
different spoken languages. They're more like the same language with a
different accent.

How many languages do you (far from fair) speak by the way?
You cannot even say this from C++ and C#

Cor
 
M

Mike Williams

We've got all of the ease of use of VB6
but with all the cool features . . .

Should that be Cool®? Oh no. I remember now. M$ tried to steal that name
for the language but failed ;-)

Mike
 
M

Michael C

Cor Ligthert said:
How many languages do you (far from fair) speak by the way?
English.

You cannot even say this from C++ and C#

I'm not sure what you're trying to say? Are you saying I don't know C++?

Michael
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top