RT

解决方案 »

  1.   

    .Net下使用WPF技术, 则不但可以轻松地在Web上实现应用程序的效果, 而且可以很简单的将应用程序转换成Web应用程序.
    1. 新建->项目->WPF Web Application
    2. 修改Page1.xaml
    <Page x:Class="WPFWebTest.Page1"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Page1">
        <Grid>
            <StackPanel>
                <TextBox Name="tbName"/>
                <Button Name="btnWelcome" Click="btnWelcome_Click" Content="Hi"/>
                <Label Name="lblWelcome"/>
            </StackPanel>
        </Grid>
    </Page>
    3. 修改Page1.xaml.cs
        public partial class Page1 : Page
        {
            public Page1()
            {
                InitializeComponent();
            }        private void btnWelcome_Click(object sender, RoutedEventArgs e)
            {
                lblWelcome.Content = "Welcome " + tbName.Text;
            }
        }