Tag Archives: events

Use the mouse wheel to scale an image in C#

This example lets you use the mouse wheel to zoom in and out on an image. To use the mouse wheel, the program needs to catch the MouseWheel event. Unfortunately that event isn’t listed in the Form Designer so you … Continue reading

Posted in events, graphics, image processing | Tagged , , , , , , , , , , | Leave a comment

Handle NumericUpDown value change events in C#

The post Make a NumericUpDown use decimal values in C# shows how you can make a NumericUpDown control display decimal values. When the user clicks a NumericUpDown control’s arrows or presses the up or down arrow key while the control … Continue reading

Posted in controls, mathematics | Tagged , , , , , , , , , | Leave a comment

Use global command bindings in WPF and C#

The example Use custom command bindings in WPF and C# explains how you can make a program use custom commands. (This is a confusing topic so read that post before you continue with this one.) That technique doesn’t quite work … Continue reading

Posted in events, user interface | Tagged , , , , , , , , , , , , , | Leave a comment

Use custom command bindings in WPF and C#

The example Use pre-defined command bindings in WPF and C# explains how you can make a program use pre-defined commands. (This is a confusing topic so read that post before you continue with this one.) This example shows how you … Continue reading

Posted in events, user interface | Tagged , , , , , , , , , , , , , | 2 Comments

Use pre-defined command bindings in WPF and C#

Command bindings provide yet another demonstration of the unofficial WPF slogan: twice as flexible and only 10 times as hard. The idea is a good one: Connect all of the program’s methods for invoking a command to a single point … Continue reading

Posted in events, user interface | Tagged , , , , , , , , , , , , | 1 Comment

Flush click events in C#

If a button starts a long task, you probably don’t want the user to be able to click the button again (or perhaps not anything in the application) until the task finishes. The following code shows a straightforward attempt to … Continue reading

Posted in API, controls, events, syntax, system, threading | Tagged , , , , , , , , , , , , , | 12 Comments

Understand event bubbling and tunneling in WPF and C#

This example demonstrates event bubbling and tunneling in WPF programs. In a Windows Forms application, a control raises an event and that’s that. WPF uses more complicated routed events that are routed through a sequence of controls. First the event … Continue reading

Posted in events, wpf | Tagged , , , , , , , , , | 1 Comment

Handle generic TreeNode mouse events in C#

This example shows how you can make a generic TreeNode class handle MouseMove and MouseDown events. It adds those events to the example described in the following posts: Make a generic TreeNode class in C#, Part 1 Make a generic … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , , , , , , , | 5 Comments