当前位置:网站首页>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("鼠标移动到按钮上面,点击事件");
}
}
}
效果
点击事件
边栏推荐
- Network cable RJ45 interface pins [easy to understand]
- 名创优品斥资6.95亿购买创始人叶国富所持办公楼股权
- Word table to Excel
- The role of /etc/profile, /etc/bashrc, ~/.bash_profile, ~/.bashrc files
- Ubantu project 4: xshell, XFTP connected the virtual machine and set xshell copy and paste the shortcut
- How to grab configuration information for DELL SC compellent storage system
- R language test whether the sample conforms to normality (test whether the sample comes from a normally distributed population): shapiro.test function tests whether the sample conforms to the normal d
- OpenShift 4 - 定制 RHACS 安全策略,阻断生产集群使用高风险 Registry
- ASP.NET Core 产生连续 Guid
- 763.划分字母区间——之打开新世界
猜你喜欢
AVH部署实践 (一) | 在Arm虚拟硬件上部署飞桨模型
WeChat chat record search in a red envelope
学习笔记12--路径-速度分解法之局部路径搜索
UnityShader入门学习(一)——GPU与Shader
使用 PyTorch 检测眼部疾病
Word table to Excel
Female service community product design
The meaning of node_exporter performance monitoring information collection in Prometheus
The paper manual becomes 3D animation in seconds, the latest research of Wu Jiajun of Stanford University, selected for ECCV 2022
Word表格转到Excel中
随机推荐
R language ggplot2 visualization: use the ggboxplot function of the ggpubr package to visualize the box plot, use the font function to customize the font size, color, style (bold, italic) of the legen
Sentinel流量控制
Prometheus之node_exporter性能监控信息采集含义
The role of /etc/profile, /etc/bashrc, ~/.bash_profile, ~/.bashrc files
力扣:56. 合并区间
工程水文学试卷
Synchronized and volatile interview brief summary
OpenShift 4 - 用 Operator 部署 Redis 集群
MySql总结
LeetCode二叉树系列——226.翻转二叉树
thread_local 变量的析构顺序
R语言ggplot2可视化:使用ggpubr包的ggboxplot函数可视化箱图、使用font函数自定义图例标题文本(legend.title)字体的大小、颜色、样式(粗体、斜体)
leetcode303场周赛复盘
TRACE32 - SNOOPer-based variable logging
SQL、HQL、JPQL 到底有什么区别
sentinel与nacos持久化
微服务架构选型
763.划分字母区间——之打开新世界
为什么黑客领域几乎一片男生?
使用 Chainlink Keepers 实现智能合约函数的自动化执行