zoukankan      html  css  js  c++  java
  • wpf

    事件响应:xaml文件中。

    <Window x:Class="myWpfone.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>
            <StackPanel Background="LightSlateGray">
                <TextBox Text="{Binding ElementName=slider1,Path=Value,Mode=OneWay}" Margin="5"/>
                <Slider x:Name="slider1" Margin="5"></Slider>
                <Button x:Name="button1" Click="button1_Click" Margin="10" Height="20" Width="100"></Button>    
            </StackPanel>
        </Grid>
        <x:Code>
            <![CDATA[
                private void button1_Click(object sender, RoutedEventArgs e)
                {
                   MessageBox.Show("1");
                }
            ]]>
        </x:Code>
        
        
    </Window>

    事件响应:cs文件中。

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Data;
    using System.Windows.Documents;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Imaging;
    using System.Windows.Navigation;
    using System.Windows.Shapes;
    
    namespace myWpfone
    {
        /// <summary>
        /// MainWindow.xaml 的交互逻辑
        /// </summary>
        public partial class MainWindow : Window
        {
            public MainWindow()
            {
                InitializeComponent();
            }
    
            private void button1_Click(object sender, RoutedEventArgs e)
            {
                MessageBox.Show("hello world!");
            }
    
      
        }
    }
    发现自己的不足,善于利用找到的方法去扬长避短。行动起来。
  • 相关阅读:
    定位
    supervisor进程管理工具
    简单git使用命令
    django + Vue项目上线部署
    Vue配置浏览器头部图标和title
    vue打包项目后 谷歌浏览器可以打开,其他浏览器不行
    js反向解析爬取企**网站
    python常用排序算法
    python脚本demo
    request模块封装
  • 原文地址:https://www.cnblogs.com/rechen/p/5115727.html
Copyright © 2011-2022 走看看