Click here to Skip to main content
16,012,082 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to check if a window is open Pin
RaviRanjanKr13-Nov-11 4:36
professionalRaviRanjanKr13-Nov-11 4:36 
QuestionIn Windows 7 I can't get a window to be shown in foreground (Win32 API) Pin
Axonn Echysttas8-Nov-11 2:38
Axonn Echysttas8-Nov-11 2:38 
AnswerRe: In Windows 7 I can't get a window to be shown in foreground (Win32 API) Pin
Axonn Echysttas9-Nov-11 1:34
Axonn Echysttas9-Nov-11 1:34 
QuestionManipulating the order event handlers are executed Pin
Bernhard Hiller8-Nov-11 0:05
Bernhard Hiller8-Nov-11 0:05 
AnswerRe: Manipulating the order event handlers are executed Pin
Alan N8-Nov-11 0:47
Alan N8-Nov-11 0:47 
GeneralRe: Manipulating the order event handlers are executed Pin
BobJanova8-Nov-11 1:18
BobJanova8-Nov-11 1:18 
GeneralRe: Manipulating the order event handlers are executed Pin
Alan N8-Nov-11 2:47
Alan N8-Nov-11 2:47 
GeneralRe: Manipulating the order event handlers are executed Pin
Bernhard Hiller8-Nov-11 2:35
Bernhard Hiller8-Nov-11 2:35 
Thanks for the idea. The more complicated thing is that I must inject that somehow into a foreign control.
I manipulated the CollectionEditor for TabPageCollection, because I want to log the changes. The collection editor has a CollectionForm, and on that form there's the removeButton.
A click on the removeButton first removes the item from the list, then my handler gets executed where I want to know which item was removed (well, found a workaround: add another handler to the MouseDown event).
That is, I'd like to get
C#
removeButton.Click += new EventHandler(removeButton_Click);

executed before the standard handler gets executed.

I tried now
C#
EventInfo ei = removeButton.GetType().GetEvent("Click");
MethodInfo mir = ei.GetRaiseMethod(true);
MethodInfo[] mis = ei.GetOtherMethods(true);
MethodInfo mic = removeButton.GetType().GetMethod("OnClick", BindingFlags.Instance| BindingFlags.NonPublic| BindingFlags.Public| BindingFlags.FlattenHierarchy);

but EventInfo does not want to show me the GetInvocationList() method, the RaiseMethod is null, and GetOtherMethods returns an empty array.
I can get the OnClick method, but do not know how to manipulate that.
Can you provide further ideas?
GeneralRe: Manipulating the order event handlers are executed Pin
Alan N8-Nov-11 5:37
Alan N8-Nov-11 5:37 
GeneralRe: Manipulating the order event handlers are executed Pin
Bernhard Hiller9-Nov-11 23:35
Bernhard Hiller9-Nov-11 23:35 
AnswerRe: Manipulating the order event handlers are executed Pin
harold aptroot8-Nov-11 2:59
harold aptroot8-Nov-11 2:59 
Questionis it possible to debug my C# program (for Windows-Mobile) Pin
goldsoft7-Nov-11 23:53
goldsoft7-Nov-11 23:53 
AnswerRe: is it possible to debug my C# program (for Windows-Mobile) Pin
Dave Kreskowiak8-Nov-11 3:08
mveDave Kreskowiak8-Nov-11 3:08 
QuestionRecording my internet browsing on file Pin
Member 83534877-Nov-11 23:46
Member 83534877-Nov-11 23:46 
AnswerRe: Recording my internet browsing on file Pin
Bernhard Hiller8-Nov-11 0:08
Bernhard Hiller8-Nov-11 0:08 
GeneralRe: Recording my internet browsing on file Pin
Member 83534878-Nov-11 0:26
Member 83534878-Nov-11 0:26 
GeneralRe: Recording my internet browsing on file Pin
BhuvanRamIconcept8-Nov-11 1:13
BhuvanRamIconcept8-Nov-11 1:13 
GeneralRe: Recording my internet browsing on file Pin
Member 83534878-Nov-11 2:13
Member 83534878-Nov-11 2:13 
AnswerRe: Recording my internet browsing on file Pin
BobJanova8-Nov-11 1:19
BobJanova8-Nov-11 1:19 
GeneralRe: Recording my internet browsing on file Pin
Member 83534878-Nov-11 3:55
Member 83534878-Nov-11 3:55 
GeneralRe: Recording my internet browsing on file Pin
BobJanova8-Nov-11 4:16
BobJanova8-Nov-11 4:16 
GeneralRe: Recording my internet browsing on file Pin
Member 83534878-Nov-11 5:04
Member 83534878-Nov-11 5:04 
GeneralRe: Recording my internet browsing on file Pin
BobJanova8-Nov-11 5:19
BobJanova8-Nov-11 5:19 
QuestionWM_NCPAINT and Massive Amount of Flicker Pin
Matt U.7-Nov-11 14:39
Matt U.7-Nov-11 14:39 
AnswerRe: WM_NCPAINT and Massive Amount of Flicker Pin
Luc Pattyn7-Nov-11 15:35
sitebuilderLuc Pattyn7-Nov-11 15:35 

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.