-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

MCTS: Microsoft Silverlight 4 Development (70-506) Certification Guide
By :

Apart from support for the good old left mouse button, Silverlight 4 has added support for the right mouse click and mouse wheel as well. Up until Silverlight 4, whenever you tried to right-click on an application, you were getting the Silverlight options menu. With the introduction of Silverlight 4, however, we can now override this default behavior and implement our own logic. In RIA applications, you would usually want to display a contextual menu.
Just like its left button sibling, handling the right mouse button can be done by handling the events of MouseRightButtonDown
and MouseRightButtonUp
. In order to prevent the default Silverlight options menu from showing up, you have to handle the MouseRightButtonDown
event, and set the Handled
property of the MouseButtonEventArgs
object to true
.
Open the Chapter6-RightClick project from the downloadable content. The project contains a simple Border
control. Handlers were added on the Border
control for both...
Change the font size
Change margin width
Change background colour