Click here to Skip to main content
15,929,596 members
Home / Discussions / C#
   

C#

 
GeneralRe: @#$%(#($ Microsoft and GDI+ Pin
Jason Hooper15-Mar-02 3:55
Jason Hooper15-Mar-02 3:55 
GeneralRe: @#$%(#($ Microsoft and GDI+ Pin
James T. Johnson15-Mar-02 8:01
James T. Johnson15-Mar-02 8:01 
GeneralRe: @#$%(#($ Microsoft and GDI+ Pin
Eric Gunnerson (msft)15-Mar-02 14:25
Eric Gunnerson (msft)15-Mar-02 14:25 
GeneralRe: @#$%(#($ Microsoft and GDI+ Pin
Christian Graus15-Mar-02 14:32
protectorChristian Graus15-Mar-02 14:32 
GeneralC# vs VB.NET. Facts not opinions please :) Pin
David Wengier15-Mar-02 0:49
David Wengier15-Mar-02 0:49 
GeneralRe: C# vs VB.NET. Facts not opinions please :) Pin
Christian Graus15-Mar-02 1:01
protectorChristian Graus15-Mar-02 1:01 
GeneralRe: C# vs VB.NET. Facts not opinions please :) Pin
James T. Johnson15-Mar-02 7:42
James T. Johnson15-Mar-02 7:42 
GeneralRe: C# vs VB.NET. Facts not opinions please :) Pin
James T. Johnson15-Mar-02 7:56
James T. Johnson15-Mar-02 7:56 
David Wengier wrote:
I guess the first question is can you do either of these

C# has overloaded the += and -= operators for events so that you can add and remove event handlers at runtime. This is also the only way that C# lets you add event handlers.

The AddHandler statement that you see in VB is VB specific and is part of the VB.NET language. However if you can get access to the underlying EventHandlerList there is an AddHandler method on that you can use. An Events property of type EventHandlerList is exposed on the System.ComponentModel.Component class and its derivatives as well as the System.Web.UI.Control class.

David Wengier wrote:
Are there things that one does that the other doesnt?

VB lets you assign events with the Handles keyword; it is also easier to do Late Binding with VB but you can accomplish the same with some Reflection in C# (or any .NET language).

C# lets you overload operators, and create/use indexers (a property on a class so that you can treat an instance of the class like an array ie foo[3]).

Someone on the DOTNET list noticed that the IL that VB.NET produces has a lot of NOPs in its code generation. While it makes the IL a little bit bigger the JIT will compile those away to nothing.

HTH,

James

Sonork ID: 100.11138 - Hasaki
"Smile your little smile, take some tea with me awhile.
And every day we'll turn another page.
Behind our glass we'll sit and look at our ever-open book,
One brown mouse sitting in a cage."
"One Brown Mouse" from Heavy Horses, Jethro Tull 1978

GeneralC# - my first stupid question Pin
Christian Graus14-Mar-02 23:27
protectorChristian Graus14-Mar-02 23:27 
GeneralRe: C# - my first stupid question Pin
James T. Johnson15-Mar-02 7:40
James T. Johnson15-Mar-02 7:40 
GeneralRe: C# - my first stupid question Pin
Christian Graus15-Mar-02 9:11
protectorChristian Graus15-Mar-02 9:11 
GeneralRe: C# - my first stupid question Pin
James T. Johnson15-Mar-02 9:26
James T. Johnson15-Mar-02 9:26 
GeneralRe: C# - my first stupid question Pin
Christian Graus15-Mar-02 9:24
protectorChristian Graus15-Mar-02 9:24 
GeneralRe: C# - my first stupid question Pin
Eric Gunnerson (msft)15-Mar-02 14:28
Eric Gunnerson (msft)15-Mar-02 14:28 
GeneralRe: C# - my first stupid question Pin
Christian Graus15-Mar-02 14:33
protectorChristian Graus15-Mar-02 14:33 
GeneralByte representation of integer Pin
14-Mar-02 17:29
suss14-Mar-02 17:29 
GeneralRe: Byte representation of integer Pin
Serge Krynine14-Mar-02 17:58
Serge Krynine14-Mar-02 17:58 
GeneralCustom Controls for ProgressBar Pin
BLaZiNiX14-Mar-02 16:39
BLaZiNiX14-Mar-02 16:39 
GeneralUpdate status of toolbar buttons Pin
paulb14-Mar-02 13:36
paulb14-Mar-02 13:36 
GeneralRe: Update status of toolbar buttons Pin
James T. Johnson14-Mar-02 13:45
James T. Johnson14-Mar-02 13:45 
QuestionHow to pronounce C#? Pin
Aleksey Suvorov14-Mar-02 9:51
Aleksey Suvorov14-Mar-02 9:51 
AnswerRe: How to pronounce C#? Pin
Larry Antram14-Mar-02 10:34
Larry Antram14-Mar-02 10:34 
GeneralRe: How to pronounce C#? Pin
Christopher Duncan14-Mar-02 10:36
Christopher Duncan14-Mar-02 10:36 
GeneralPE (Portable Executable) Pin
14-Mar-02 5:56
suss14-Mar-02 5:56 
GeneralRe: PE (Portable Executable) Pin
Andres Manggini14-Mar-02 6:44
Andres Manggini14-Mar-02 6:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.