nim_duilib/docs/Controls/Button.md
2019-04-19 17:19:57 +08:00

32 lines
682 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Button按钮
按钮一般用于提供用户主动发起一项功能。
`Button` 控件继承了 `Label` 控件属性和方法,更多可用属性和方法请参考:[Label](Label.md) 控件
## 可用属性
```xml
<!-- 一个名称为 btn_submit宽度为 100px高度为 30px 的按钮 -->
<Button name="btn_submit" width="100" height="30"/>
```
## 可用接口
| 接口名称 | 用途 |
| :--- | :--- |
| [AttachClick](#AttachClick) | 绑定鼠标点击处理函数 |
### AttachClick
绑定鼠标点击处理函数
```cpp
void AttachClick(const EventCallback& callback)
```
-&emsp;数:
- `callback` 要绑定的回调函数
- 返回值:无