Jump to content
Sign in to follow this  
JScript

GUI - Códigos relacionados à Janelas

Recommended Posts

GUI - Códigos relacionados à Janelas

 

Conteúdo

  • Botões (Checkboxes, radio...)
  • GUI (Forms, Janelas...)
  • Imagens e Gráficos
  • Like 1

Share this post


Link to post
Share on other sites
_GUICtrlCreateInputEx
;Author: JScript - Snippet Version No. = 1.0
;Snippet was Created Using AutoIt Version = 3.3.8.1, Creation Date = 28/05/12.

; Controle Input com a tecla [Enter] funcional!
Func _GUICtrlCreateInputEx($sText, $iLeft, $iTop, $iWidth = -1, $iHeight = -1, $iStyle = -1, $iExStyle = -1)
	Local $iCtrlID

	$iCtrlID = GUICtrlCreateInput($sText, $iLeft, $iTop, $iWidth, $iHeight, $iStyle, $iExStyle)
	; To [Enter] key effect!
	Local $aAccelKeys[1][2] = [["{ENTER}", $iCtrlID]]
	GUISetAccelerators($aAccelKeys)
	;---
	Return $iCtrlID
EndFunc[/code]

Exemplo de uso:
[spoiler]
[code]#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

_Example()

Func _Example()
	Local $hForm, $iInput

	$Form1 = GUICreate("Input control with [Enter] key!", 320, 240, -1, -1)

	$iInput = _GUICtrlCreateInputEx("Type [Enter] key to see the effect!", 14, 100, 290, 23)

	GUICtrlCreateButton("Button", 105, 165, 100)

	GUISetState(@SW_SHOW)

	While 1
		$nMsg = GUIGetMsg()
		Switch $nMsg
			Case $GUI_EVENT_CLOSE
				Exit
			Case $iInput
				MsgBox(4096, "Read!", GUICtrlRead($iInput))
		EndSwitch
	WEnd
EndFunc   ;==>_Example

  • Like 4

Share this post


Link to post
Share on other sites
Sign in to follow this  

×