Click here to Skip to main content
15,885,546 members

Comments by Frans Jan (Top 24 by date)

Frans Jan 14-Jan-13 2:55am View    
I don't know about that, but maybe this post helps: http://social.msdn.microsoft.com/Forums/en-US/csharplanguage/thread/464d3388-0db9-4755-8d5f-ebe2593ce8c2
or: http://stackoverflow.com/questions/896574/forcing-a-wpf-tooltip-to-stay-on-the-screen

I also found that you can click through a label when you set the property "Enabled" to false
Frans Jan 30-Nov-12 7:47am View    
Yes you have parameters to be passed, no you don't use them. This means that you can use the second solution. Simply call: KeyBoard_Lock(null, null);

To use my first solution do this (you can name SomeFunction() to whatever you like):

public void SomeFunction()
{
if (receivedData == "###LOCK###")
{
actHook = new UserActivityHook();
// crate an instance with global hooks
// hang on events
//actHook.OnMouseActivity+=new MouseEventHandler(MouseMoved);
actHook.KeyDown += new KeyEventHandler(MyKeyDown);
actHook.KeyPress += new KeyPressEventHandler(MyKeyPress);
actHook.KeyUp += new KeyEventHandler(MyKeyUp);
}
}

Then do this:

private void ListenToServer()
{
SomeFunction();
}

public void KeyBoard_Lock(object sender, System.EventArgs e)
{
SomeFunction();
}

So now, you call your SomeFunction() in ListenToServer(), but as you see, KeyBoard_Lock(object sender, System.EventArgs e) does the same.
Frans Jan 30-Nov-12 7:03am View    
AA23 is not empty. It has a IF statement, with 0 when true and 1 when false. Default is true, so it's default value is zero, not empty.
object oMissing = Type.Missing;
Frans Jan 30-Nov-12 6:46am View    
In my example I wanted to call the button click EventHandler in the KeyDown EventHandler, but why? I asked myself. Why should I want to call a buttonClick EventHandler in a KeyDown EventHandler, that's too confusing, because, after all, one EventHandler is for a buttonClick where the other is for the KeyDown, right? So why would I want to call a buttonClick EventHandler in my KeyDown EventHandler. Or, if you are not calling it in an other EventHandler, but in a function, why would you want to call the buttonClick EventHandler (or some other EventHandler) if you are not performing that action? So that's why I decided to put my code of the button click EventHandler in it's own function, and then have my button click EventHandler and my KeyDown EventHandler to call that function. Both are calling the same function, so both are doing the same.

Calling an EventHandler when you are not raising that event is confusing.
Frans Jan 30-Nov-12 6:11am View    
Already worked on that ;)