当前位置:网站首页>button控件的使用
button控件的使用
2022-07-31 15:08:00 【济南医疗小程序状元】
button控件的使用
<Window x:Class="WpfApp1.control.Windowbutton"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfApp1.control"
mc:Ignorable="d"
Title="Windowbutton" Height="450" Width="800">
<Grid>
<Button Width="100" Height="30" HorizontalAlignment="Left"
VerticalAlignment="Top"
Content="I is a 按钮" Margin="30,30,0,0"
Background="Teal"
BorderThickness="5,0,0,0" BorderBrush="Transparent"
Foreground="White"
Click="Button_Click" MouseMove="Button_MouseMove"
>
</Button>
</Grid>
</Window>
XAML.CS文件
using System;
using System.Collections.Generic;
using System.Text;
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.Shapes;
namespace WpfApp1.control
{
/// <summary>
/// Windowbutton.xaml 的交互逻辑
/// </summary>
public partial class Windowbutton : Window
{
public Windowbutton()
{
InitializeComponent();
}
/// <summary>
/// 按钮的点击事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_Click(object sender, RoutedEventArgs e)
{
MessageBox.Show("按钮被点击了,点击事件");
}
private void Button_MouseMove(object sender, MouseEventArgs e)
{
//MessageBox.Show("鼠标移动到按钮上面,点击事件");
}
}
}
效果
点击事件
边栏推荐
- 乡村基冲刺港交所:5个月期内亏2224万 SIG与红杉中国是股东
- OpenShift 4 - 定制 RHACS 安全策略,阻断生产集群使用高风险 Registry
- SQL、HQL、JPQL 到底有什么区别
- 三角恒等变换公式
- Gorm—Go语言数据库框架
- 【MySQL】Mysql范式及外键作用
- RecyclerView高效使用第三节
- 力扣:738.单调递增的数字
- NPM Taobao mirror (latest version) released a new version of npm mirror at 2021-11-21 16:53:52 [easy to understand]
- 基于极限学习机(ELM)进行多变量用电量预测(Matlab代码实现)
猜你喜欢
随机推荐
763.划分字母区间——之打开新世界
element-plus虚拟表格virtual-list组件中是怎么实现清理lodash.memoize缓存的?
SIGABRT 报错时的注意事项和解决方法
RecyclerView高效使用第二节
公告
svn安装及使用(身体功能手册)
DeepLab Series Learning
蔚来杯2022牛客暑期多校训练营4
大健云仓冲刺美股:增营收反减利润 京东与DCM是股东
【CUDA学习笔记】初识CUDA
Efficient use of RecyclerView Section 3
abaqus find contact pairs报错:surface name is already in use
思路迪医药冲刺港股:5个月亏2.9亿 泰格医药与先声药业是股东
梅克尔工作室-第一次
Female service community product design
R language ggplot2 visualization: use the ggmapplot function of the ggpubr package to visualize the MA plot (MA-plot), the font.legend parameter and the font.main parameter to set the title and legend
Word表格转到Excel中
Word table to Excel
Recommendation System - Recall Phase - 2013: DSSM (Twin Towers Model) [Embedding (Semantic Vector) Recall] [Microsoft]
Trigonometric identity transformation formula