如何阻止在组合框中写入?

  • 本文关键字:何阻止 组合 autoit
  • 更新时间 :
  • 英文 :


如何拒绝在输入(组合,编辑…等等),或者拒绝写其他输入?

Func GUIListeConfigs()
Global $GUIListeConfigs = GUICreate("Configs", 319, 156, 684, 408, -1, BitOR(0x00000080,0x00000008,0x08000000, $CBS_DROPDOWNLIST))
$GroupBox1 = GUICtrlCreateGroup("", 8, 1, 305, 97)
Global $Combo1 = GUICtrlCreateCombo("", 72, 56, 169, 25)
$Label1 = GUICtrlCreateLabel("Selectionnez une Configuration", 48, 16, 226, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
GUICtrlCreateGroup("", -99, -99, 1, 1)
Global $ButtonChargerConfig = GUICtrlCreateButton("&OK", 73, 107, 75, 25)
$cEnterDummy = GUICtrlCreateDummy()
Local $aAccelKeys[1][2] = [["{ENTER}", $cEnterDummy]]
GUISetAccelerators($aAccelKeys)
Global $ButtonAnnulerChargerConfig = GUICtrlCreateButton("Cancel", 170, 107, 75, 25)
GUISetState(@SW_HIDE, $GUIListeConfigs)
#EndRegion ### END Koda GUI secw²tion ###
EndFunc

这是你正在寻找的吗?

#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>
#include<ComboConstants.au3>
Example()
Func Example()
; Create a GUI with various controls.
Local $hGUI = GUICreate("Example", 300, 200)
; Create a combobox control.
Local $idComboBox = GUICtrlCreateCombo("Item 1", 10, 10, 185, 20, bitOR($GUI_SS_DEFAULT_COMBO, $CBS_DROPDOWNLIST))
Local $idButton_Close = GUICtrlCreateButton("Close", 210, 170, 85, 25)
; Add additional items to the combobox.
GUICtrlSetData($idComboBox, "Item 2|Item 3", "Item 2")
; Display the GUI.
GUISetState(@SW_SHOW, $hGUI)
Local $sComboRead = ""
; Loop until the user exits.
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE, $idButton_Close
ExitLoop
Case $idComboBox
$sComboRead = GUICtrlRead($idComboBox)
MsgBox($MB_SYSTEMMODAL, "", "The combobox is currently displaying: " & $sComboRead, 0, $hGUI)
EndSwitch
WEnd
; Delete the previous GUI and all controls.
GUIDelete($hGUI)
EndFunc   ;==>Example

相关内容

  • 没有找到相关文章

最新更新