1. Trang chủ
  2. » Công Nghệ Thông Tin

AutoIT Help part 53 pdf

7 309 0
Tài liệu đã được kiểm tra trùng lặp

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

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 7
Dung lượng 74,7 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

GUICtrlCreateRadio "text", left, top [, width [, height [, style [, exStyle]]]] Parameters text text hiện trị sẵn trên control left tọa độ X width chiều rộng height chiều cao style ki

Trang 1

EndFunc ;==>Example

Function Reference

GUICtrlCreateRadio

tạo một Radio button control cho GUI

GUICtrlCreateRadio ( "text", left, top [, width [, height [, style [, exStyle]]]] )

Parameters

text text hiện trị sẵn trên control

left tọa độ X

width chiều rộng

height chiều cao

style

kiểu xem thêm GUI Control Styles Appendix

default ( -1) : none

forced styles : $BS_AUTORADIOBUTTON and $WS_TABSTOP if first radio in the group

exStyle kiểu mở rộng xem Extended Style Table

Return Value

Success: trả lại ControlID

Failure: Returns 0

Remarks

Trang 2

để lấy giá trị của control ta dùng GUICtrlRead

để đặt các thuộc tính cho control ta dùng GUICtrlSet

để sử dụng nhiều kiểu trong style ta dùng BitOr($GUI_SS_DEFAULT_RADIO,

newstyle, )

để có thể dùng đc các biến trên ta cần phải khai báo thư viện #include

<ButtonConstants.au3> in your script

Default resizing is $GUI_DOCKHEIGHT

Related

GUICoordMode (Option), GUICtrlSet , GUIGetMsg

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()

Local $radio1, $radio2, $msg

GUICreate("My GUI radio") ; will create a dialog box that when displayed is centered

$radio1 = GUICtrlCreateRadio("Radio 1", 10, 10, 120, 20)

$radio2 = GUICtrlCreateRadio("Radio 2", 10, 40, 120, 20)

GUICtrlSetState($radio2, $GUI_CHECKED)

GUISetState() ; will display an dialog box with 1 checkbox

; Run the GUI until the dialog is closed

While 1

$msg = GUIGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

Trang 3

ExitLoop

Case $msg = $radio1 And BitAND(GUICtrlRead($radio1),

$GUI_CHECKED) = $GUI_CHECKED

MsgBox(64, 'Info:', 'You clicked the Radio 1 and it is Checked.') Case $msg = $radio2 And BitAND(GUICtrlRead($radio2),

$GUI_CHECKED) = $GUI_CHECKED

MsgBox(64, 'Info:', 'You clicked on Radio 2 and it is Checked.') EndSelect

WEnd

EndFunc ;==>Example

Function Reference

GUICtrlCreateSlider

tạo một Slider control cho GUI

GUICtrlCreateSlider ( left, top [, width [, height [, style [, exStyle]]]] )

Parameters

height H

style

kiểu, xem GUI Control Styles Appendix

default (-1) : $TBS_AUTOTICKS exStyle kiểu mở rộng, xem Extended Style Table

Return Value

Trang 4

Success: trả lại ControlID

Failure: Returns 0

Remarks

để lấy giá trị của control ta dùng GUICtrlRead

để đặt các thuộc tính cho control ta dùng GUICtrlSet

để thay đổi giá trị ta dùng GUICtrlSetData

để đặt giá trị to nhất và nhỏ nhất ta dùng GUICtrlSetLimit

để sử dụng nhiều kiểu trong style ta dùng BitOr($GUI_SS_DEFAULT_SLIDER,

newstyle, )

để có thể dùng đc các biến trên ta cần phải khai báo thư viện #include

<SliderConstants.au3> in your script

Default resizing is $GUI_DOCKAUTO size and position will occur

Related

GUICoordMode (Option), GUICtrlSetData, GUICtrlSetLimit, GUICtrlSet , GUIGetMsg

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()

Local $slider1, $button, $msg

GUICreate("slider", 220, 100, 100, 200)

Trang 5

GUISetBkColor(0x00E0FFFF) ; will change background color

$slider1 = GUICtrlCreateSlider(10, 10, 200, 20)

GUICtrlSetLimit(-1, 200, 0) ; change min/max value

$button = GUICtrlCreateButton("Value?", 75, 70, 70, 20)

GUISetState()

GUICtrlSetData($slider1, 45) ; set cursor

Do

$msg = GUIGetMsg()

If $msg = $button Then

MsgBox(0, "slider1", GUICtrlRead($slider1), 2)

EndIf

Until $msg = $GUI_EVENT_CLOSE

EndFunc ;==>Example

Function Reference

GUICtrlCreateTab

tạo một Tab control cho GUI

GUICtrlCreateTab ( left, top [, width [, height [, style [, exStyle]]]] )

Parameters

height H

style

kiểu, xem GUI Control Styles Appendix

default ( -1) : none

forced styles : $WS_TABSTOP, $WS_CLIPSIBLINGS

Trang 6

exStyle kiểu mở rộng, xem Extended Style Table

Return Value

Success: trả lại ControlID

Failure: Returns 0

Remarks

mọi control đc tạo trong tabitem sẽ thuộc tabitem đó (giống như group ý)

để thay đổi giá trị ta dùng GUICtrlSet

để sử dụng nhiều kiểu trong style ta dùng BitOr($GUI_SS_DEFAULT_TAB,

newstyle, )

để có thể dùng đc các biến trên ta cần phải khai báo thư viện #include

<TabConstants.au3> in your script

Default resizing is $GUI_DOCKSIZE

Related

GUICtrlCreateTabItem, GUICoordMode (Option), GUICtrlCreate ,

GUICtrlSet , GUIGetMsg

Example

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Trang 7

Func Example()

Ngày đăng: 02/07/2014, 17:21

TỪ KHÓA LIÊN QUAN

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN