I have two labels on a form. I want to be able to drag one label over the other and while the mouse left button is still down I want to be able to press space key to toggle target label's text between "foo" and "bar".
Seems like all input events are suppressed while mouse left button is not released.
Am I missing something? Any samples?
Check out the GiveFeedback event. Maybe you can check from there if a key is being pressed.
EDIT:
void panel1_QueryContinueDrag(object sender, QueryContinueDragEventArgs e)
{
if (Keyboard.IsKeyDown(Key.Space))
{
if (label1.Text == "foo") label1.Text = "bar"; else label1.Text = "foo";
}
}
and add a reference to PresentaionCore and: WindowBase (You'll find that in: C:\Program Files (x86)\ReferenceAssemblies\Microsoft\Framework\v3.0\ .)
You'll have to play with this a little.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With