wp7开发之创建第一个Silverlight应用程序
2012-03-20 00:00
337 查看
首先创建一个新的项目:
打开开发工具File/new Project:
如图所示,修改自己为项目定义的名字。
点击OK 就进入到了如下界面:
双击 page name 字体 在右下角Properties中修改Text 的内容为my browser。
然后在最左边Toolbox,拖拽一个button 和TextBox 到视图界面 ,然后分别修改button的内容为go 和TextBox 的内容为http://blog.csdn.net/wangkuifeng0118,最后在拖拽一个WebBrowser控件到视图中:
会出现如上图所示的界面效果,其中右边的MainPage.xaml中新增加了如下代码:
接下来添加button 相应事件,双击go按钮 会进入到MainPage.xaml.cs:
点击绿色按钮,开始调试。
出现上图界面,然后点击go按钮 :
完成,总体开发起来,好像比android还要简单,哈哈!
$(document).ready(function(){dp.SyntaxHighlighter.HighlightAll('code');});
原文链接:
http://blog.csdn.net/wangkuifeng0118/article/details/7061613
打开开发工具File/new Project:
如图所示,修改自己为项目定义的名字。
点击OK 就进入到了如下界面:
双击 page name 字体 在右下角Properties中修改Text 的内容为my browser。
然后在最左边Toolbox,拖拽一个button 和TextBox 到视图界面 ,然后分别修改button的内容为go 和TextBox 的内容为http://blog.csdn.net/wangkuifeng0118,最后在拖拽一个WebBrowser控件到视图中:
会出现如上图所示的界面效果,其中右边的MainPage.xaml中新增加了如下代码:
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"> <Button Content="go" Height="72" HorizontalAlignment="Left" Margin="345,45,0,0" Name="button1" VerticalAlignment="Top" Width="111" Click="button1_Click" /> <TextBox Height="72" HorizontalAlignment="Left" Margin="0,45,0,0" Name="textBox1" Text="http//www.xbox.com" VerticalAlignment="Top" Width="356" TextChanged="textBox1_TextChanged" /> <phone:WebBrowser HorizontalAlignment="Stretch" Margin="0,84,0,0" Name="webBrowser1" VerticalAlignment="Stretch" Height="Auto" Width="Auto" /> </Grid>
接下来添加button 相应事件,双击go按钮 会进入到MainPage.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.Shapes; using Microsoft.Phone.Controls; namespace myFirstPhone { public partial class MainPage : PhoneApplicationPage { // Constructor public MainPage() { InitializeComponent(); } private void button1_Click(object sender, RoutedEventArgs e) { } } }编写如下代码:
private void button1_Click(object sender, RoutedEventArgs e) { //得到TextBox控件中的值 String site = textBox1.Text; //启动webBrowser webBrowser1.Navigate(new Uri(site,UriKind.Absolute)); }代码已经编写完成,下面看一下运行和调试:
点击绿色按钮,开始调试。
出现上图界面,然后点击go按钮 :
完成,总体开发起来,好像比android还要简单,哈哈!
$(document).ready(function(){dp.SyntaxHighlighter.HighlightAll('code');});
原文链接:
http://blog.csdn.net/wangkuifeng0118/article/details/7061613
相关文章推荐
- wp7开发之创建第一个Silverlight应用程序
- wp7开发之创建第一个Silverlight应用程序
- 菜鸟学Windows Phone 8开发(1)——创建第一个应用程序
- Silverlight 2 实验手册之一 创建第一个Hello World 应用程序(附示例项目下载)
- 创建第一个简单的Silverlight应用程序
- [翻译]WP7 QuickStart-第一篇-创建第一个Windows Phone应用程序
- 创建第一个简单的Silverlight应用程序
- flex开发(1)---创建您的第一个应用程序
- [演练]创建您的第一个Silverlight应用程序
- SilverLight商业应用程序开发---学习笔记(10)使用数据源窗口创建DataGrid
- IOS 入门开发之创建第一个应用程序
- Android开发之 Windows环境下通过Eclipse创建的第一个安卓应用程序(图文详细步骤)
- Windows Phone 系列- 创建第一个 Silverlight 应用程序
- 一、利用Visual Studio 2010创建第一个基于服务和数据驱动的Silverlight应用程序
- Silverlight学习笔记(三):创建第一个Silverlight应用程序
- Java开发环境的安装和第一个应用程序的创建
- 菜鸟学Windows Phone 8开发(1)——创建第一个应用程序
- [翻译]WP7 QuickStart-第一篇-创建第一个Windows Phone应用程序
- 一行代码不用敲,15分钟轻松搞定GIS开发,GISer福音,教你如何从下载到使用webappbuilder创建第一个应用程序(不用申请有使用期限的企业账号哦!)
- 【转载】IOS 入门开发之创建第一个应用程序(一)