新建silverlight项目,双击MainPage.xaml
插入下列代码:
< Canvas Background = " White " > <!-- 声明文本输入框名称为tbInput --> < TextBox x:Name = " tbInput " Width = " 300 " Height = " 50 " Canvas.Top = " 30 " Canvas.Left = " 30 " FontSize = " 30 " /> <!-- 绑定按钮的Click事件 --> < Button x:Name = " btn1 " Width = " 120 " Height = " 50 " Canvas.Top = " 30 " Canvas.Left = " 350 " FontSize = " 20 " Content = " 请按我 " Click = " btn1_Click " /> <!-- 声明TextBox名称为tbkView --> < TextBlock x:Name = " tbkView " Canvas.Top = " 120 " Canvas.Left = " 40 " FontFamily = " Arial Black " FontSize = " 60 " Foreground = " YellowGreen " MouseEnter = " tbkView_MouseEnter " /> </ Canvas >
运行后,在文本框输入内容并按按钮,显示的效果:
转载于:https://www.cnblogs.com/jianglan/archive/2011/07/12/2104333.html
相关资源:垃圾分类数据集及代码