Marlett 字体中有 最小化/最大化/关闭按钮 字符

供新手入门和老手参考的教程和相关资料,包括中文帮助

Moderators: tmplinshi, arcticir

tmplinshi
Posts: 1604
Joined: 01 Oct 2013, 14:57

Marlett 字体中有 最小化/最大化/关闭按钮 字符

08 Sep 2014, 12:15

Image

示例:

Code: Select all

; =================================
;		界面
; =================================
Gui, -Caption +Border +HwndHGUI
Gui, Margin, 20, 20
Gui, Color, White

Gui, Font, s12, Marlett ; 设置字体为 Marlett
Gui, Add, Button, x578 w29 h25 -Theme 0x8000 gGuiMinimize, 0 ; 最小化按钮
Gui, Add, Button, x+0 wp hp -Theme 0x8000 Disabled, 1 ; 最大化按钮
Gui, Add, Button, x+0 wp hp -Theme 0x8000 gGuiClose, r ; 关闭按钮
Gui, Font ; 恢复默认字体

Gui, Add, ActiveX, xm w645 h300, http://urldecode.org
Gui, Show
Return

; =================================
;		最小化
; =================================
GuiMinimize:
	Gui, Minimize
Return

; =================================
;		退出
; =================================
GuiClose:
ExitApp

; ======================================================================================

; 拖拽界面
WM_LBUTTONDOWN(wParam, lParam, msg, hwnd) {
	global HGUI
	static WM_LBUTTONDOWN := OnMessage(0x0201, "WM_LBUTTONDOWN")
	If (hwnd = HGUI)
		PostMessage, 0xA1, 2
}
截图:
Image

当然了,这样创建的按钮不够漂亮。要美化的话可以用 Class_ImageButton,参考北京时间校准器。如果还要按钮 ToolTip 提示,可以用 Class_GuiControlTips。
Last edited by tmplinshi on 09 Sep 2014, 10:26, edited 3 times in total.
User avatar
RobertL
Posts: 546
Joined: 18 Jan 2014, 01:14
Location: China

Re: Marlett 字体中有 最小化/最大化/关闭按钮 字符

08 Sep 2014, 19:49

哇,不错呢,精简、清晰有胃口。
水一下..占楼备用..
我为人人,人人为己?

Return to “教程资料”

Who is online

Users browsing this forum: No registered users and 17 guests