Giáo Trình How To Use AutoIt A Professional Manner part 65 pps

5 236 0
Giáo Trình How To Use AutoIt A Professional Manner part 65 pps

Đang tải... (xem toàn văn)

Thông tin tài liệu

GUICtrlCreateCheckbox("Notify #2", 10, -1) ; next cell in the line GUISetCoord(20, 60) GUICtrlCreateButton("OK #3", -1, -1) GUICtrlCreateButton("Cancel #4", 10, -1) GUICtrlSetState(-1, $GUI_FOCUS) GUISetState() ; will display an empty dialog box ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd EndFunc ;==>Example Function Reference GUISetCursor Sets the mouse cursor icon for a GUI window. GUISetCursor ( [cursorID [, override [, winhandle]]] ) Parameters cursorID [optional] Cursor Id (See Remarks). override [optional] Force the requested mouse cursor even when over controls (see below). 0 = (default) Don't override a control's default mouse cursor. 1= override control's default mouse cursor. winhandle [optional] Windows handle as returned by GUICreate (default is the previously used Window). Return Value Success: Returns 1. Failure: Returns 0. Remarks If the cursorID is invalid the standard arrow will be displayed. Usually when you move the mouse cursor over an edit control or other control the mouse cursor changes shape. The "override" option allows you to force the requested mouse cursor to be shown at all times. Note: If you have changed a controls mouse cursor with GUICtrlSetCursor then this control mouse cursor will always be shown. For a list of valid cursor IDs see MouseGetCursor. CursorId = 16 will hide the mouse cursor. Related GUICtrlSetCursor Example #include <GUIConstantsEx.au3> Opt('MustDeclareVars', 1) Global $IDC = -1, $newIDC = 0 Example() Func Example() HotKeySet("{Esc}", "Increment") GUICreate("Press Esc to Increment", 400, 400, 0, 0, 0x04CF0000, 0x00000110) GUISetState() While GUIGetMsg() <> $GUI_EVENT_CLOSE If $newIDC <> $IDC Then $IDC = $newIDC GUISetCursor($IDC) EndIf ToolTip("GUI Cursor #" & $IDC) WEnd EndFunc ;==>Example Func Increment() $newIDC = $IDC + 1 If $newIDC > 15 Then $newIDC = 0 EndFunc ;==>Increment Function Reference GUISetFont Sets the default font for a GUI window. GUISetFont (size [, weight [, attribute [, fontname [, winhandle]]]] ) Parameters size Fontsize (default is 8.5). weight [optional] Font weight (default 400 = normal). attribute [optional] To define italic:2 underlined:4 strike:8 char format (add together the values of all the styles required, 2+4 = italic and underlined). fontname [optional] Font to use. (OS default GUI font is used if the font is "" or is not found). winhandle [optional] Windows handle as returned by GUICreate (default is the previously used window). Return Value Success: Returns 1. Failure: Returns 0. Remarks See the Appendix for a complete list of Windows fonts and Windows versions under which they are supported. Size can contain a decimal as in 8.5. For some control as label ones the default can be 8.5 instead of 9 according to Windows Theme Values. Related GUICtrlSetFont Example #include <GUIConstantsEx.au3> Opt('MustDeclareVars', 1) Example() Func Example() Local $font, $msg GUICreate("My GUI default font") ; will create a dialog box that when displayed is centered $font = "Comic Sans MS" GUISetFont(9, 400, 4, $font) ; will display underlined characters GUICtrlCreateLabel("underlined label", 10, 20) GUISetFont(9, 400, 2, $font) ; will display underlined characters GUICtrlCreateLabel("italic label", 10, 40) GUISetFont(9, 400, 8, $font) ; will display underlined characters GUICtrlCreateLabel("strike label", 10, 60) GUISetState() ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd EndFunc ;==>Example Function Reference GUISetHelp Sets an executable file that will be run when F1 is pressed. GUISetHelp ( helpfile [, winhandle] ) Parameters helpfile file that will be run if F1 is pressed when the GUI is active. winhandle [optional] Windows handle as returned by GUICreate (default is the previously used window). . option allows you to force the requested mouse cursor to be shown at all times. Note: If you have changed a controls mouse cursor with GUICtrlSetCursor then this control mouse cursor will always. underlined:4 strike:8 char format (add together the values of all the styles required, 2+4 = italic and underlined). fontname [optional] Font to use. (OS default GUI font is used if the font is. of 9 according to Windows Theme Values. Related GUICtrlSetFont Example #include <GUIConstantsEx.au3> Opt('MustDeclareVars', 1) Example() Func Example() Local $font,

Ngày đăng: 08/07/2014, 20:20

Tài liệu cùng người dùng

Tài liệu liên quan