DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Wed, 22 Aug 2007 08:22:40 -0700,    posted on: microsoft.public.dotnet.framework.windowsforms        back       

Thread Index
  1    unknown


Check if an event is already handled   
I created a windows form control that inherits from the standard .Net
DataGridView control, to which I've added custom functionality.
Instead of using the standard control in my applications, I use my
customized version. I have an event handler in the custom control for
the KeyDown event that simulates a double-click on the selected grid
row when the user presses the enter key. This is working just fine.

Now, some screens that are using this custom control handle the grid's
KeyDown event themselves, so in those cases I don't want the KeyDown
event handler in the custom control class to handle the event. Is
there some check I can perform in the custom control, without adding
anything to the screens that use it, to see if the event is already
being handled? Something like this:

private void MyDataGridView_KeyDown(object sender, KeyEventArgs e)
{
  if ( /* check if the KeyDown event is already being handled
elsewhere */ )
  {
    return;
  }
  else
  {
    SimulateDoubleClick();
  }
}

Apparently, GetInvocationList() is supposed to return all of the
handlers for an event, but "this.KeyDown.GetInvocationList()" does not
compile. Thanks!
Date:Wed, 22 Aug 2007 08:22:40 -0700   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us