Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/23/2022 in all areas

  1. FGAIFEN

    Help with code (newbie)

    Thanks everyone for helping me.
    1 point
  2. Yes it does flicker a lot. But I do not have to courage to debug such a long script. Here a small reproducer that shows it is working well. #include <GuiConstants.au3> #include <WindowsConstants.au3> #include <GuiRichEdit.au3> Const $sRegKey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" Local $hGUI = GUICreate("Test", 400, 300, 400, 400) $cCombo_Font = GUICtrlCreateCombo("", 10, 10, 170, 20, BitOR($CBS_SORT, $CBS_DROPDOWN, $CBS_AUTOHSCROLL, $WS_VSCROLL)) GUICtrlSetData($cCombo_Font, _RegEnumVal($sRegKey)) $cLabel = GUICtrlCreateLabel("Font preview", 230, 10, 155, 20) $idRich = _GUICtrlRichEdit_Create($hGUI, "This is a test. Long enough to be seen even if the combo is active. Please select a part that you can see.", 10, 100, 380, 150, $ES_NOHIDESEL) GUISetState() While True $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit Case $cCombo_Font GUICtrlSetFont($cLabel, 10, Default, Default, GUICtrlRead($cCombo_Font)) _GUICtrlRichEdit_SetFont($idRich, 10, GUICtrlRead($cCombo_Font)) EndSwitch WEnd Func _RegEnumVal($sKey) Local $i = 1, $sVal, $sResult While 1 $sVal = RegEnumVal($sKey, $i) If @error Then ExitLoop $i += 1 $sResult &= $sVal & "|" WEnd Return StringRegExpReplace($sResult, " \(.*?\)", "") EndFunc ;==>_RegEnumVal
    1 point
  3. FGAIFEN

    Help with code (newbie)

    I'm so dumm.... So solution is "$letter = GUICtrlRead($combo1,1)" in every $BUTTON1 .....
    1 point
  4. Nine

    Help with code (newbie)

    I am going to give you a trick. After you have tried every single possible things and you are still failing, you open help file and you start reading... As stated in help file for GUICtrlRead, it says there is 2 parameters : first is ControlId (in your case you want to read from a combobox, right ?). Second parameter is advanced and there is only 2 possible choices (0 or 1). Nothing else. Then it says the result depends on the control (as already mentioned, you want to read from a combobox). So it says for combo : the value selected (isn't that what you want ?) So now what do you think, your statement should be ?
    1 point
  5. Why don't you ask in the ahk forum in stead of in the AutoIt3 forum?
    1 point
×
×
  • Create New...