2 Replies - 2067 Views - Last Post: 27 October 2011 - 05:41 AM Rate Topic: -----

#1 timmack   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 38
  • Joined: 31-January 11

How to change the event handler of the listview control in C#?

Posted 26 October 2011 - 10:40 PM

Hello!

I'm new to C# and I'm trying to learn it. I used most of my work using vb.net. I have some issues in c# which I can't figure out. I know this sounds kind a silly but I'm sorry for being newbie to this software. I just wanted to know how to change the default event handler of each control. Let'say if I want to change the event handler of the listview control which is obviously the SelectedIndexChange. How do may I change it to MouseClick, Click, or DoubleClick perhaps.

Thanks for any assistance.

Is This A Good Question/Topic? 0
  • +

Replies To: How to change the event handler of the listview control in C#?

#2 wiero   User is offline

  • D.I.C Head

Reputation: 49
  • View blog
  • Posts: 78
  • Joined: 29-June 11

Re: How to change the event handler of the listview control in C#?

Posted 27 October 2011 - 05:31 AM

do you want to change default event which is used by forms designer? i think it is not possible since it is set by attribute in .net code.
Was This Post Helpful? 0
  • +
  • -

#3 tlhIn`toq   User is offline

  • Xamarin Cert. Dev.
  • member icon

Reputation: 6535
  • View blog
  • Posts: 14,450
  • Joined: 02-June 10

Re: How to change the event handler of the listview control in C#?

Posted 27 October 2011 - 05:41 AM

Wiero is right. You can't change the default handler the designer uses.

Let me ask you this: Why do you need to? All the events are available to you on the events page of the properties pallet. Just go to the event you want, and double-click in the blank space next to the event name.

If you need to change the default because you are setting up a LOT of controls and need to set a handler for each one - so many that changing the default in designer is helpful - then you need to re-examine what you are building because it is probably wrong.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1