Create a Silverlight project and double-click mainpage. XAML.
Insert the followingCode:
< Canvas background = " White " >
<! -- Declare text input box name as tbinput -->
< Textbox X: Name = " Tbinput "
Width = " 300 " Height = " 50 "
Canvas. Top = " 30 " Canvas. Left = " 30 "
Fontsize = " 30 " />
<! -- Click Event of the bound button -->
< Button X: Name = " Btn1 "
Width = " 120 " Height = " 50 "
Canvas. Top = " 30 " Canvas. Left = " 350 "
Fontsize = " 20 " Content = " Press me "
Click = " Btn1_click " />
<! -- Declare textbox name as tbkview -->
< Textblock X: Name = " Tbkview "
Canvas. Top = " 120 " Canvas. Left = " 40 "
Fontfamily = " Arial black "
Fontsize = " 60 "
Foreground = " Yellowgreen "
Mouseenter = " Tbkview_mouseenter " />
</ Canvas >
After running, enter the content in the text box and press the button to display the effect: