zoukankan      html  css  js  c++  java
  • WPF开发简介教程

    1/ VS中文件-新建-项目-WPF应用程序
    2/ 左上角工具箱中有很多组件可以直接拖拽使用

    3/ 双击组件,进入脚本功能编辑界面,如按钮:

    private void Button_Click_1(object sender,EventArgs e)
    {
       MessageBox.Show("Wonderful!");
    }
    
    


    
    

    4/ ctrl+F5 编译运行5/ 总代码:

    <Window x:Class="鳄鱼啊鳄鱼.MainWindow"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            Title="MainWindow" Height="350" Width="525">
        <Grid>
            <Grid.Background>
                <LinearGradientBrush>
                    <GradientStop Offset="0" Color="Blue"></GradientStop>
                    <GradientStop Offset="0.5" Color="LightBlue"></GradientStop>
                </LinearGradientBrush>
            </Grid.Background>
            <TextBox Height="23" Margin="10,10,10,0" Name="textBox1" VerticalAlignment="Top" Text="{Binding ElementName=slider1, Path=Value, UpdateSourceTrigger=PropertyChanged}" TextChanged="textBox1_TextChanged" />
            <Slider Height="21" Margin="10,40,10,0" Name="slider1" VerticalAlignment="Top" Maximum="100" />
            <Button Content="Button" HorizontalAlignment="Left" Height="50" Margin="48,172,0,0" VerticalAlignment="Top" Width="138" Click="Button_Click"/>
            <Label Content="当前时间--" HorizontalAlignment="Left" Height="66" Margin="263,172,0,0" VerticalAlignment="Top" Width="204"/>
            <Button Content="Button1" HorizontalAlignment="Left" Height="52" Margin="48,258,0,0" VerticalAlignment="Top" Width="125" Click="Button_Click_1"/>
            <CheckBox Content="CheckBox" HorizontalAlignment="Left" Height="39" Margin="263,245,0,0" VerticalAlignment="Top" Width="109" Checked="CheckBox_Checked"/>
            <ComboBox HorizontalAlignment="Left" Margin="335,91,0,0" VerticalAlignment="Top" Width="120" SelectionChanged="ComboBox_SelectionChanged"/>
        </Grid>
    </Window>

    前后都是一样的,套路;
    效果:


  • 相关阅读:
    github中建立pages
    批处理指令_windows定时关机脚本
    批处理指令_同步数据脚本
    python_笔记
    python_操作outlook
    按键精灵_一些踩过的坑
    linux_一些踩过的坑
    python_快速排序
    python_jira库的一些常用操作
    jira_一些踩过的坑
  • 原文地址:https://www.cnblogs.com/caymanlu/p/6361697.html
Copyright © 2011-2022 走看看