大佬教程收集整理的这篇文章主要介绍了silverlight 2.0 入门教程(一),大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
前几天由于自己的家里的电脑出了一点上的问题,重新做了一下系统,把所有的东西都重新做了一次,没有天急写这方面的文章。今天从公司里面把silverlight 2.0 的SDK下载了下来,这里我就不说这么多的话吧,还是来看看哟
首先在这里声明一点,可能没有其他的高手写得哪么的精,但是我的文章是为了给初学者一点帮助就OK了
在你自己的电脑按装VS2008,装好以后可到关方网站上下一个silverlight 2.0 SDK,这个SDK大约有50M,也不很大,
注:如果你是VS2005,你是安装不上的2.0的SDK,只有VS2008才可以,这个我自己测试过;安装这个有一点慢,要用心等,
上面的工作完了以后,我们就可以开始建一个项目了
这里可以在你的项目中会出一silverlight 这个模板,选择它,会出一个对话框子,这里可以任一选一个,都可以,主要是用来托管它,在我们的解决方案中就会出现,
这是我们不做任何的操作,只将我们的项目重新生成一下就OK了,会发现我们的工程中有多了一个文件夹,这个文件夹把所有的silverlight 用来的DLL通过了高压缩。
后下面的代码:
代码说明:
HorizontalAlihnment:是Grid排版方面,他有四个值,Stretch,right,center,left
showGridLines:显示出Grid中的网格线,默认为false
在给按钮加事件时,只要我们给按钮取上一个名字,在page.xaml.cs后台代码会自动给我们写来,
我们只是写事件下面应该做什么就OK
@H_502_29@
< UserControl x:Class = " SilverlightApplication1.Page "@H_502_29@
xmlns = " http://scheR_10_11845@as.microsoft.com/client/2007 "@H_502_29@
xmlns:x = " http://scheR_10_11845@as.microsoft.com/winfx/2006/xaml "@H_502_29@
Width = " 400 " Height = " 300 " >@H_502_29@
< Grid x:Name = " LayoutRoot " BACkground = " Blue " HorizontalAlignment = " Left " ShowGridLines = " True " >@H_502_29@
< Grid.RowDeFinitions >@H_502_29@
< RowDeFinition Height = " 100 " />@H_502_29@
< RowDeFinition Height = " 100 " />@H_502_29@
< RowDeFinition Height = " 100 " />@H_502_29@
</ Grid.RowDeFinitions >@H_502_29@
< Grid.columnDeFinitions >@H_502_29@
< columnDeFinition Width = " 100 " />@H_502_29@
< columnDeFinition Width = " 100 " />@H_502_29@
< columnDeFinition Width = " 100 " />@H_502_29@
</ Grid.columnDeFinitions >@H_502_29@
< Button x:Name = " @H_224_48@myButton " Content = " Push Me " Width = " 100 " Height = " 50 " Grid.column = " 1 " Grid.Row = " 0 " Click = " @H_224_48@myButton_Click " ></ Button >@H_502_29@
< Button x:Name = " @H_224_48@myButton2 " Content = " Button2 " Width = " 100 " Height = " 50 " Grid.column = " 0 " Grid.Row = " 1 " Click = " @H_224_48@myButton2_Click " ></ Button >@H_502_29@
< Button x:Name = " @H_224_48@myButton3 " Content = " Button3 " Width = " 100 " Height = " 50 " Grid.column = " 2 " Grid.Row = " 1 " Click = " @H_224_48@myButton3_Click " ></ Button >@H_502_29@
< Button x:Name = " @H_224_48@myButton4 " Content = " Button4 " Width = " 100 " Height = " 50 " Grid.column = " 1 " Grid.Row = " 2 " Click = " @H_224_48@myButton4_Click " ></ Button >@H_502_29@
< Button x:Name = " @H_224_48@myButton5 " Content = " Button5 " Width = " 100 " Height = " 50 " Grid.column = " 2 " Grid.Row = " 0 " Click = " @H_224_48@myButton5_Click " ></ Button >@H_502_29@
@H_502_29@
</ Grid >@H_502_29@
</ UserControl >@H_502_29@
@H_502_29@
using System;@H_502_29@
using System.Collections.Generic;@H_502_29@
using System.Linq;@H_502_29@
using System.Windows;@H_502_29@
using System.Windows.Controls;@H_502_29@
using System.Windows.Documents;@H_502_29@
using System.Windows.Input;@H_502_29@
using System.Windows.Media;@H_502_29@
using System.Windows.Media.Animation;@H_502_29@
using System.Windows.Shapes;@H_502_29@
@H_502_29@
namespace SilverlightApplication1{
以上是大佬教程为你收集整理的silverlight 2.0 入门教程(一)全部内容,希望文章能够帮你解决silverlight 2.0 入门教程(一)所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。