Yep. That's C#!
I'm finding out these things the hard way. I have stumbled across the
information, somewhere, that the EventArgs parameter is empty by design,
i.e. that is the default!
You have to arrange for the sender object to put something in there. Which
means that you have to write the code yourself. You have to derive your own
EventArgs class from the built-in System. But there again, the different
'controls', have different pre-built 'events handlers'.
Although the 'handlers' all having the same 'signature' - they return
'void' and have those two parameters - the names, e.g. the event handler
built into the built-in 'timer' object is named 'Elapsed', and its event arg
is named 'ElapsedEventArgs' - their contents, are not.
This information from two differrent (expensive!) Microsoft books - I have
five such, including a famous O'Reilly brand - many more person-to-person
(i.e. pirated) e-books, 'help' files etc.etc. and two months on, I still
can't find out how to stop a simple double-click from defaulting to blueing
up a selected word. It is that easy with JavaScript ('return true'!) in
html.
Encapsulation? ArrRRRRRRRRRrrrrgh!
Eddie
"Jesper" <Je****@discussions.microsoft.com> wrote in message
news:4D**********************************@microsof t.com...
Hi,
Im fairly new to C# but have som experience in the C++/MFC world and I am
a bit confused as I cant find some information that I am used to having.
I am trying to use the RichTextBox control and specifically the Protected
event. In C# I get no arguments to this event (well I do but the EventArgs
object contains no usefull information). If I was to receive this as a
message in C++, by receiveing the EN_PROTECTED notification, I would get
this structure
typedef struct _enprotected {
NMHDR nmhdr;
UINT msg;
WPARAM wParam;
LPARAM lParam;
CHARRANGE chrg;
} ENPROTECTED;
as well as the notification. This contains lots of useful information.
Whats happening here, how do i get hold of this information in C#? I assume
I am missing something fairly obvious...
Thanks,
Jesper