Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / March 2005

Tip: Looking for answers? Try searching our database.

Add Event Handler

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jacky Luk - 13 Mar 2005 12:07 GMT
I want to include some code for the MouseDown Event. I would like to add
this for the formview or a picturebox, how come there are no messages for me
to choose from. Even I created a button, no messages are shown in the pick
dialog box....any help is appreicated
Thanks
jack
Peter van der Goes - 13 Mar 2005 15:04 GMT
>I want to include some code for the MouseDown Event. I would like to add
>this for the formview or a picturebox, how come there are no messages for
>me to choose from. Even I created a button, no messages are shown in the
>pick dialog box....any help is appreicated
> Thanks
> jack

Let's start with the template you're using. What type of C++ project are we
talking about?

Signature

Peter [MVP Visual Developer]
Jack of all trades, master of none.

Peteroid - 14 Mar 2005 01:10 GMT
For ANY object 'control' which is derived from Control* the following will
add a mouse down handler for it:

control->MouseDown += new MouseEventHandler( handler_namespace_pointer,
handler_name ) ;

and the handler must be of the form:

void handler_name(  Object* control, MouseEventArgs e ) ;

Other event handlers are done similarly. It is good practive to also remove
these handlers when deconstructing (although in a gc environment this is not
necessary), and be aware you can add the same handler more than once if not
careful...

Hope this helps...

[==Peteroid==]

>I want to include some code for the MouseDown Event. I would like to add
>this for the formview or a picturebox, how come there are no messages for
>me to choose from. Even I created a button, no messages are shown in the
>pick dialog box....any help is appreicated
> Thanks
> jack
Jacky Luk - 14 Mar 2005 02:23 GMT
I'll use MFC and the wizard
Thanks
Jack

"Jacky Luk" <jl@knight.com> ???g???l???s?D
:uPzyjz7JFHA.3184@TK2MSFTNGP09.phx.gbl...
> I want to include some code for the MouseDown Event. I would like to add
[quoted text clipped - 3 lines]
> Thanks
> jack
Amoula100 - 14 Mar 2005 13:11 GMT
you have go to your form design, you display control's proprieties,
and you click on icon "events"(yellow icon) in the proprieties panel,
there are all events for the selected control, you doube click on the
event you want to add and code will be added automatically

tel me if you do it

> I want to include some code for the MouseDown Event. I would like to add
> this for the formview or a picturebox, how come there are no messages for me
> to choose from. Even I created a button, no messages are shown in the pick
> dialog box....any help is appreicated
> Thanks
> jack
Jacky Luk - 14 Mar 2005 14:01 GMT
Hi I'm using MFC. As I was rendering in the formview,
I found there were no corresponding event handlers for Mouseclick.(Even
nothing else), do i have to adjust the settings? Basically all new objects I
put on the form have no event handlers to add. They were all empty for the
yellow icon...
Thanks
Jack

"Amoula100" <Amal.jibar@gmail.com>
???????:852160ee.0503140411.7667ab2f@posting.google.com...
> you have go to your form design, you display control's proprieties,
> and you click on icon "events"(yellow icon) in the proprieties panel,
[quoted text clipped - 11 lines]
>> Thanks
>> jack
Peter van der Goes - 15 Mar 2005 16:25 GMT
> Hi I'm using MFC. As I was rendering in the formview,
> I found there were no corresponding event handlers for Mouseclick.(Even
[quoted text clipped - 3 lines]
> Thanks
> Jack

As you are asking about event handlers in MFC and nobody here appears to
have anything else to add, may I suggest that you post your question in:

microsoft.public.mfc

I believe you'll find answers there.

Signature

Peter [MVP Visual Developer]
Jack of all trades, master of none.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.