• 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!");
            }
    
      
        }
    }
    发现自己的不足,善于利用找到的方法去扬长避短。行动起来。
  • 相关阅读:
    AngularJS双向绑定,手动实施观察
    AngularJS的Hello World
    LESS碎语
    chrome浏览器调试报错:Failed to load resource: the server responsed width a status of 404 (Not Found)…http://127.0.0.1:5099/favicon.ico
    AngularJS报错:[$compile:tpload]
    Javascript中的依赖注入
    使用HTML5和CSS3碎语
    在Brackets中使用Emmet
    使用Brackets
    Bootstrap碎语
  • 原文地址:https://www.cnblogs.com/rechen/p/5115727.html
Copyright © 2020-2023  润新知