网站 建设 网站设计公司,wordpress主题诗词,网店设计图片,十大网上购物平台1.下载安装silverlight#xff1a;Microsoft Silverlight™ 3 Tools #xff08;安装之前需要升级VS2008到SP1#xff09; 2.和多数人一样我的程序新建好运行调试报错#xff0c;提示“未安装silverlight托管调试包”#xff0c;后来我使用VS2010新建的时候提示安装silver… 1.下载安装silverlightMicrosoft® Silverlight™ 3 Tools 安装之前需要升级VS2008到SP1 2.和多数人一样我的程序新建好运行调试报错提示“未安装silverlight托管调试包”后来我使用VS2010新建的时候提示安装silverlight更高版本Silverlight_Developer.exe我安装好后就OK了然后运行VS2008的项目也没有报错了整理一下我自己的安装顺序 VS2008后来又安装了VS2010framework3.5-SP1 VS2008—SP1 silverlight3,Silverlight_Developer.exe。 3.新建项目 新建一个silverlight导航应用程序 然后找到Views中的Home.xaml文件 F5调试运行 然后添加silverlight控件button 和 textbox 双击按钮书写代码 Home.xaml页面代码 代码 navigation:Page x:ClassSilverlightApplication3.Home xmlnshttp://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:xhttp://schemas.microsoft.com/winfx/2006/xaml xmlns:dhttp://schemas.microsoft.com/expression/blend/2008 xmlns:mchttp://schemas.openxmlformats.org/markup-compatibility/2006 xmlns:navigationclr-namespace:System.Windows.Controls;assemblySystem.Windows.Controls.Navigation mc:Ignorabled d:DesignWidth640 d:DesignHeight480 Title主页 Style{StaticResource PageStyle} xmlns:dataInputclr-namespace:System.Windows.Controls;assemblySystem.Windows.Controls.Data.Input Grid x:NameLayoutRoot ScrollViewer x:NamePageScrollViewer Style{StaticResource PageScrollViewerStyle} StackPanel x:NameContentStackPanel TextBlock x:NameHeaderText Style{StaticResource HeaderTextStyle} Text主页/ Button Content点我 Height42 Namebutton1 Width119 Clickbutton1_Click FontSize16 FontWeightBold / TextBlock x:NameContentText Style{StaticResource ContentTextStyle} Text主页内容/ TextBox Height23 NametextBox1 Width120 / /StackPanel /ScrollViewer /Grid/navigation:Page Home.xaml.cs 代码 using System;using System.Collections.Generic;using System.Linq;using System.Net;using System.Windows;using System.Windows.Controls;using System.Windows.Documents;using System.Windows.Input;using System.Windows.Media;using System.Windows.Media.Animation;using System.Windows.Navigation;using System.Windows.Shapes;namespace SilverlightApplication3{ public partial class Home : Page { public Home() { InitializeComponent(); } // 当用户导航到此页面时执行。 protected override void OnNavigatedTo(NavigationEventArgs e) { } private void button1_Click(object sender, RoutedEventArgs e) { HeaderText.Text 我的第一个silverlight应用程序; textBox1.Text DateTime.Now.ToString(); } }} 转载于:https://www.cnblogs.com/Simcoder/archive/2010/09/28/1837228.html