• windows phone 浏览器 (1)(转)


    windows phone 浏览器 (1)

     

         windows phone 浏览器主要用的控件是phone:WebBrowser,该控件就是windows phone中的IE,在grid控件嵌套的grid控件中添加如下代码:

     1    <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">

    复制代码
    2             <TextBox Height="Auto" HorizontalAlignment="Stretch" Margin="0,0,120,0" Name="textBox1" Text="http://www.cnblogs.com" VerticalAlignment="Top" />
    3             <Button Content="搜索" Height="Auto" HorizontalAlignment="Right"  Name="button1" VerticalAlignment="Top" Width="Auto" Click="button1_Click" />
    4             <phone:WebBrowser HorizontalAlignment="Stretch" Margin="0,84,0,0" Name="webBrowser1" VerticalAlignment="Stretch" Height="Auto" Width="Auto" />
    5         </Grid>
    复制代码

     相关的效果会在显示呈现:

     

     并在button事件中如下代码

     1 private void button1_Click(object sender, RoutedEventArgs e)

    2         {
    3             string site;
    4             site = textBox1.Text;
    5             webBrowser1.Navigate(new Uri(site, UriKind.Absolute));
    6             
    7         }

     整体运行效果:

     

    新浪:

     

  • 相关阅读:
    C#正则表达式
    HDU 1009 FatMouse' Trade
    HDU 1022 Train Problem I
    HDU 3665 Seaside
    (转)qsort完整版用法
    HDU 1061 Rightmost Digit (矩阵快速幂)
    HDU 2817 A sequence of numbers
    HDU 1943 Ball bearings
    HDU 1058 Humble Numbers
    HDU 4278 Faulty Odometer
  • 原文地址:https://www.cnblogs.com/zhanghaifeng/p/2482220.html
Copyright © 2020-2023  润新知