Tuesday, December 8, 2009

SilverLight 4.0 Mouse Wheel Event

 

Today I downloaded and Installed SL 4.0 Beta SDK on my Windows 64 bit Machine. There are many new features added to it,but i wanted to try simple one and see how this works. so In this Blog post i am going to show sliverlight 4.0 new mouse wheel event.

image

1) First Download and Install SilverLight 4.0 Beta SDK. you can download  SL 4.0 SDK from http://silverlight.net/getstarted/silverlight-4-beta/ 

After installing first create Silverlight 4.0 project in VS.NET 2010 Beta 2

image

Make sure that you select Silverlight version 4.0 from dropdown list.

 

image

Here i am going to create simple UI which has one  </TextBlock> with some text . Now i am going to write code for TextBlock MouseWheelEvent.

image

image

In MouseWheelEvent args we could  capture the delta (change) value  and assign to  TextBlock FontSize property. so that when you scroll mouse ball up and down the text on the </TextBlock> UI Element will change as well.

 

UI – Before MouseWheelEvent

image

UI-After MouseWheelEvent.

image

Nandri(Thanks)

SreenivasaRagavan.

No comments: