Jump to content
Sign in to follow this  
dickjones007

GUICtrlCreateCombo menu help

Recommended Posts

dickjones007

I have this:

$vrsta = GUICtrlCreateCombo("", 20, 190, 200, 25)
GUICtrlSetData(-1, "Mjesecna|Polugodisnja|Godisnja","Mjesecna")

Whats the code for a return value to use in IF condition?

for example

If Polugodisnja is selected from dropdown menu then display one picture

elseif diplay another

endif

Share this post


Link to post
Share on other sites
trancexx

Something like this:

Switch GUICtrlRead($vrsta)
    Case "Mjesecna"
        ; nesto za mjesecnu
    Case "Polugodisnja"
        ; nesto za polugodisnju
    Case "Godisnja"
        ; nesto za godisnju
EndSwitch

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
dickjones007

yes exactly like that, but its not working right

my first selection displays picture at once but every other choice i make, i have to do it twice before the right picture comes up.

is it because i use GUICtrlCreateCombo? is there any other control for dropdown menu?

i have tried

GUICtrlCreateList. same result have to click twice on a line to get wanted pic

i also tried

        GUICtrlDelete("mjesecna.jpg")
        GUICtrlDelete("polugodisnja.jpg")
        GUICtrlDelete("godisnja.jpg")

before every selection but it does the same thing

Edited by dickjones007

Share this post


Link to post
Share on other sites
dickjones007

now tried

$radio1 = GUICtrlCreateRadio("Mjesecna", 310, 310, 120, 20)
$radio2 = GUICtrlCreateRadio("Polugodisnja", 310, 340, 120, 20)
$radio3 = GUICtrlCreateRadio("Godisnja", 310, 370, 120, 20)
Select
            Case $msg = $radio1 And BitAND(GUICtrlRead($radio1), $GUI_CHECKED) = $GUI_CHECKED
                GUICtrlCreatePic("mjesecna.jpg", 256, 0, 364, 228)
            Case $msg = $radio2 And BitAND(GUICtrlRead($radio2), $GUI_CHECKED) = $GUI_CHECKED
                GUICtrlCreatePic("polugodisnja.jpg", 256, 0, 364, 228)
            Case $msg = $radio3 And BitAND(GUICtrlRead($radio3), $GUI_CHECKED) = $GUI_CHECKED
                GUICtrlCreatePic("godisnja.jpg", 256, 0, 364, 228)
EndSelect

does not diplay pics at all

help with this maybe?

Edited by dickjones007

Share this post


Link to post
Share on other sites
dickjones007

no help?

Share this post


Link to post
Share on other sites
Melba23

dickjones007,

If you post your code and the images needed we might be able to help. As it is you have been shown exactly how the code for reading the combo should be written - if it does not work for you it is because there is a problem elsewhere in the code. So there is no point in offering you any help unless we can see that code. ;)

Over to you. :)

M23


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______Open Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
dickjones007

no problem, here is the code and images

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Compile_Both=y
#AutoIt3Wrapper_UseX64=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <DateTimeConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Date.au3>
Opt("GUIOnEventMode", 1)
HotKeySet("^x", "izlaz1")

#region --- CodeWizard generated code Start ---
;SpashImage features: Title=No, Width=900, Height=400, Always On Top
SplashImageOn("", "twisterfun.jpg", "900", "400", "-1", "-1", 1)
Sleep(1000)
SplashOff()
#endregion --- CodeWizard generated code Start ---


#region ### START Koda GUI section ### Form=C:\Documents and Settings\SlavonskiBrod01\My Documents\My Pictures\Form1.kxf
$Form1_1 = GUICreate("Twisterichne kartice", 624, 450, 192, 114, $WS_BORDER)
$MenuItem1 = GUICtrlCreateMenu("&Izbornik")
$MenuItem4 = GUICtrlCreateMenuItem("&Nova kartica", $MenuItem1)
GUICtrlSetOnEvent($MenuItem4, "svenovo1")
$MenuItem9 = GUICtrlCreateMenuItem("&Izdane kartice", $MenuItem1)
GUICtrlSetOnEvent($MenuItem9, "izdane1")
$MenuItem7 = GUICtrlCreateMenu("&O programu")
$MenuItem3 = GUICtrlCreateMenuItem("---------------", $MenuItem1)
$MenuItem5 = GUICtrlCreateMenuItem("I&zlaz (Ctrl+x)", $MenuItem1)
GUICtrlSetOnEvent($MenuItem5, "izlaz1")

$imeprezime = GUICtrlCreateInput("", 100, 40, 120, 21, BitOR($ES_UPPERCASE, $ES_OEMCONVERT))
GUICtrlCreateLabel("Ime i prezime:", 20, 43, 80, 15)
$adresa = GUICtrlCreateInput("", 100, 66, 120, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_UPPERCASE))
GUICtrlCreateLabel("Adresa:", 20, 69, 80, 15)
$posta = GUICtrlCreateInput("", 100, 92, 120, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_NUMBER, $ES_OEMCONVERT))
GUICtrlSetLimit(-1, 5, 5)
GUICtrlCreateLabel("Broj pošte:", 20, 95, 80, 15)
$grad = GUICtrlCreateInput("", 100, 118, 120, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_UPPERCASE, $ES_OEMCONVERT))
GUICtrlCreateLabel("Grad:", 20, 121, 80, 15)

$datum = GUICtrlCreateDate(_NowDate(), 20, 280, 200, 20, $DTS_SHORTDATEFORMAT)
$datumx = _NowDate()
$datumizd = GUICtrlCreateLabel("Datum izdavanja kartice", 20, 260, 118, 15)


$vrijedido = GUICtrlCreateLabel("Vrijedi do:", 20, 320, 50, 17)
;~ $datumizdtxt2 = ControlGetText("Twisterichne kartice", "", "[ID:12]")


$vrsta = GUICtrlCreateCombo("", 20, 170, 200, 25)
;~ $vrsta = GUICtrlCreateList("", 312, 272, 113, 110)
GUICtrlSetData(-1, "Mjesecna|Polugodisnja|Godisnja", "")
GUICtrlSetOnEvent($vrsta, "kartica1")
$vrstakar = GUICtrlCreateLabel("Vrsta kartice", 20, 150, 200, 15)

$brojkartlabel = GUICtrlCreateLabel("Broj kartice", 20, 200, 200, 15)
$brojkart = GUICtrlCreateInput("", 20, 220, 60, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_NUMBER))
$djelatna = GUICtrlCreateLabel("Djelatnik:", 20, 17, 60, 15)
$djelatnici = GUICtrlCreateCombo("", 100, 13, 119, 25)
GUICtrlSetData(-1, "Anita Tihi|Nikolina Matanovic", "Anita Tihi")
$Spremi = GUICtrlCreateButton("Spremi", 20, 368, 75, 25)
GUICtrlSetOnEvent($Spremi, "spremi1")
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###

While 1

    $msg = GUIGetMsg()

    Switch $msg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

Func svenovo1() ;put empty values into fields
ControlSetText ("Twisterichne kartice", "", "[CLASS:Edit; INSTANCE:1]","")
ControlSetText ("Twisterichne kartice", "", "[CLASS:Edit; INSTANCE:2]","")
ControlSetText ("Twisterichne kartice", "", "[CLASS:Edit; INSTANCE:3]","")
ControlSetText ("Twisterichne kartice", "", "[CLASS:Edit; INSTANCE:4]","")
ControlSetText ("Twisterichne kartice", "", "[CLASS:Edit; INSTANCE:5]","")
ControlSetText ("Twisterichne kartice", "", "[CLASS:Edit; INSTANCE:6]","")
EndFunc   ;==>svenovo1

Func kartica1()
    Switch GUICtrlRead($vrsta)

        Case "Mjesecna"
            GUICtrlCreatePic("mjesecna.jpg", 256, 0, 364, 228)
            $dodandatum = _DateAdd('M', 1, _NowCalcDate())
            $konvdatum = StringSplit($dodandatum, "/")
            $novidatum = Number($konvdatum[3]) & "." & Number($konvdatum[2]) & "." & StringRight($konvdatum[1], 4)
        Case "Polugodisnja"
            GUICtrlCreatePic("polugodisnja.jpg", 256, 0, 364, 228)
            $dodandatum = _DateAdd('M', 6, _NowCalcDate())
            $konvdatum = StringSplit($dodandatum, "/")
            $novidatum = Number($konvdatum[3]) & "." & Number($konvdatum[2]) & "." & StringRight($konvdatum[1], 4)
        Case "Godisnja"
            GUICtrlCreatePic("godisnja.jpg", 256, 0, 364, 228)
            $dodandatum = _DateAdd('M', 12, _NowCalcDate())
            $konvdatum = StringSplit($dodandatum, "/")
            $novidatum = Number($konvdatum[3]) & "." & Number($konvdatum[2]) & "." & StringRight($konvdatum[1], 4)
    EndSwitch
    $vrijedido2 = GUICtrlCreateLabel($novidatum, 80, 320, 100, 17)
EndFunc   ;==>kartica1

Func spremi1()

    $imeprezimetxt = ControlGetText("Twisterichne kartice", "", "[CLASS:Edit; INSTANCE:1]")
    $adresatxt = ControlGetText("Twisterichne kartice", "", "[CLASS:Edit; INSTANCE:2]")
    $postatxt = ControlGetText("Twisterichne kartice", "", "[CLASS:Edit; INSTANCE:3]")
    $gradtxt = ControlGetText("Twisterichne kartice", "", "[CLASS:Edit; INSTANCE:4]")
    $brojkarttxt = ControlGetText("Twisterichne kartice", "", "[CLASS:Edit; INSTANCE:6]")
    $datumizdtxt = ControlGetText("Twisterichne kartice", "", "[CLASS:SysDateTimePick32; INSTANCE:1]")
    $djelatnicitxt = ControlGetText("Twisterichne kartice", "", "[CLASS:Edit; INSTANCE:7]")
    $vrijedidotxt = ControlGetText("Twisterichne kartice", "", "[CLASS:Static; INSTANCE:11]")
    FileWrite(@ScriptDir & "\izdane kartice\" & $brojkarttxt & "_" & $imeprezimetxt & ".txt", @CRLF & "PREZIME I IME:   " & $imeprezimetxt & @CRLF & "ADRESA:       " & $adresatxt & @CRLF & "MJESTO:       " & $postatxt & " " & $gradtxt & @CRLF & "BROJ KARTICE: " & $brojkarttxt & @CRLF & "KARTICA IZDANA: " & $datumizdtxt & @CRLF & "VRIJEDI DO: " & $vrijedidotxt & @CRLF & @CRLF & "DJELATNICA:    " & $djelatnicitxt)
    MsgBox(4096, "Podatci", "Podatci spremljeni u txt file pod imenom:" & @CRLF & $brojkarttxt & "_" & $imeprezimetxt & ".txt")
EndFunc   ;==>spremi1

Func izdane1()

;~  MsgBox(4,"Pregled izdanih kartica","#Region --- CodeWizard generated code Start ---
;MsgBox features: Title=Yes, Text=Yes, Buttons=Yes and No, Icon=Question
If Not IsDeclared("iMsgBoxAnswer") Then Local $iMsgBoxAnswer
$iMsgBoxAnswer = MsgBox(36,"Pregled izdanih kartica","Da li zelite otvoriti direktorij u kojem se nalaze izdane kartice?")
Select
    Case $iMsgBoxAnswer = 6 ;Yes
        Run("Explorer.exe " & @ScriptDir & "\izdane kartice")
    Case $iMsgBoxAnswer = 7 ;No
        Sleep(100)
EndSelect
#EndRegion --- CodeWizard generated code End ---

EndFunc   ;==>izdane1

Func izlaz1()
    Exit
EndFunc   ;==>izlaz1

so again, when i choose "Vrsta kartice" the first time, right pic comes up, but changing the choice of the field does not change the pic until i choose the sam thing again (even tho the date in "Vrijedi do:" filed changes correctly every time).

hope i was clear enough

PS also any advice in simplifying the code is welcome

post-64653-0-02262800-1384025086_thumb.j

post-64653-0-15591300-1384025090_thumb.j

post-64653-0-56848100-1384025095_thumb.j

post-64653-0-89330300-1384025099_thumb.j

Edited by dickjones007

Share this post


Link to post
Share on other sites
MHz

I have made some changes. Creating a picture control in a function without destroying the previous picture control is just add another one on top of the previous one. So put control creation in global code and update with GUICtrlSetImage. Replace some functions with Gui... equivalents so it remains handling by internal control ids. I left the picture and label control below the GuiSetState though you can move up into the main gui code if you would like to. Differcult for me to understand the language used so I cannot be sure of doing a good fix.

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Compile_Both=y
#AutoIt3Wrapper_UseX64=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <DateTimeConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Date.au3>
Opt("GUIOnEventMode", 1)
HotKeySet("^x", "izlaz1")

#region --- CodeWizard generated code Start ---
;SpashImage features: Title=No, Width=900, Height=400, Always On Top
SplashImageOn("", "twisterfun.jpg", "900", "400", "-1", "-1", 1)
Sleep(1000)
SplashOff()
#endregion --- CodeWizard generated code Start ---


#region ### START Koda GUI section ### Form=C:\Documents and Settings\SlavonskiBrod01\My Documents\My Pictures\Form1.kxf
$Form1_1 = GUICreate("Twisterichne kartice", 624, 450, 192, 114, $WS_BORDER)
$MenuItem1 = GUICtrlCreateMenu("&Izbornik")
$MenuItem4 = GUICtrlCreateMenuItem("&Nova kartica", $MenuItem1)
GUICtrlSetOnEvent($MenuItem4, "svenovo1")
$MenuItem9 = GUICtrlCreateMenuItem("&Izdane kartice", $MenuItem1)
GUICtrlSetOnEvent($MenuItem9, "izdane1")
$MenuItem7 = GUICtrlCreateMenu("&O programu")
$MenuItem3 = GUICtrlCreateMenuItem("---------------", $MenuItem1)
$MenuItem5 = GUICtrlCreateMenuItem("I&zlaz (Ctrl+x)", $MenuItem1)
GUICtrlSetOnEvent($MenuItem5, "izlaz1")

$imeprezime = GUICtrlCreateInput("", 100, 40, 120, 21, BitOR($ES_UPPERCASE, $ES_OEMCONVERT))
GUICtrlCreateLabel("Ime i prezime:", 20, 43, 80, 15)
$adresa = GUICtrlCreateInput("", 100, 66, 120, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_UPPERCASE))
GUICtrlCreateLabel("Adresa:", 20, 69, 80, 15)
$posta = GUICtrlCreateInput("", 100, 92, 120, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_NUMBER, $ES_OEMCONVERT))
GUICtrlSetLimit(-1, 5, 5)
GUICtrlCreateLabel("Broj pošte:", 20, 95, 80, 15)
$grad = GUICtrlCreateInput("", 100, 118, 120, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_UPPERCASE, $ES_OEMCONVERT))
GUICtrlCreateLabel("Grad:", 20, 121, 80, 15)

$datum = GUICtrlCreateDate(_NowDate(), 20, 280, 200, 20, $DTS_SHORTDATEFORMAT)
$datumx = _NowDate()
$datumizd = GUICtrlCreateLabel("Datum izdavanja kartice", 20, 260, 118, 15)


$vrijedido = GUICtrlCreateLabel("Vrijedi do:", 20, 320, 50, 17)
;~ $datumizdtxt2 = ControlGetText("Twisterichne kartice", "", "[ID:12]")


$vrsta = GUICtrlCreateCombo("", 20, 170, 200, 25)
;~ $vrsta = GUICtrlCreateList("", 312, 272, 113, 110)
GUICtrlSetData(-1, "Mjesecna|Polugodisnja|Godisnja", "")
GUICtrlSetOnEvent($vrsta, "kartica1")
$vrstakar = GUICtrlCreateLabel("Vrsta kartice", 20, 150, 200, 15)

$brojkartlabel = GUICtrlCreateLabel("Broj kartice", 20, 200, 200, 15)
$brojkart = GUICtrlCreateInput("", 20, 220, 60, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_NUMBER))
$djelatna = GUICtrlCreateLabel("Djelatnik:", 20, 17, 60, 15)
$djelatnici = GUICtrlCreateCombo("", 100, 13, 119, 25)
GUICtrlSetData(-1, "Anita Tihi|Nikolina Matanovic", "Anita Tihi")
$Spremi = GUICtrlCreateButton("Spremi", 20, 368, 75, 25)
GUICtrlSetOnEvent($Spremi, "spremi1")
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###

; *** create these here and not over and over in a function
$pic = GUICtrlCreatePic("", 256, 0, 364, 228)
$vrijedido2 = GUICtrlCreateLabel('', 80, 320, 100, 17)

While 1
    Sleep(10) ; *** it is oneventmode so GUIGetMsg will not work
;~     $msg = GUIGetMsg()

;~     Switch $msg
;~         Case $GUI_EVENT_CLOSE
;~             Exit

;~     EndSwitch
WEnd

Func svenovo1() ;put empty values into fields
    GUICtrlSetData($imeprezime, '')
    GUICtrlSetData($adresa, '')
    GUICtrlSetData($posta, '')
    GUICtrlSetData($grad, '')
    GUICtrlSetData($vrsta, '')
    GUICtrlSetData($brojkart, '')
    GUICtrlSetImage($pic, "")
EndFunc   ;==>svenovo1

Func kartica1()
    Switch GUICtrlRead($vrsta)

        Case "Mjesecna"
            GUICtrlSetImage($pic, "mjesecna.jpg")
            $dodandatum = _DateAdd('M', 1, _NowCalcDate())
            $konvdatum = StringSplit($dodandatum, "/")
            $novidatum = Number($konvdatum[3]) & "." & Number($konvdatum[2]) & "." & StringRight($konvdatum[1], 4)
        Case "Polugodisnja"
            GUICtrlSetImage($pic, "polugodisnja.jpg")
            $dodandatum = _DateAdd('M', 6, _NowCalcDate())
            $konvdatum = StringSplit($dodandatum, "/")
            $novidatum = Number($konvdatum[3]) & "." & Number($konvdatum[2]) & "." & StringRight($konvdatum[1], 4)
        Case "Godisnja"
            GUICtrlSetImage($pic, "godisnja.jpg")
            $dodandatum = _DateAdd('M', 12, _NowCalcDate())
            $konvdatum = StringSplit($dodandatum, "/")
            $novidatum = Number($konvdatum[3]) & "." & Number($konvdatum[2]) & "." & StringRight($konvdatum[1], 4)
    EndSwitch
    GUICtrlSetData($vrijedido2, $novidatum)
EndFunc   ;==>kartica1

Func spremi1()

    $imeprezimetxt = GUICtrlRead($imeprezime)
    $adresatxt = GUICtrlRead($adresa)
    $postatxt = GUICtrlRead($posta)
    $gradtxt = GUICtrlRead($grad)
    $brojkarttxt = GUICtrlRead($brojkart)
    $datumizdtxt = GUICtrlRead($datum); *** $datum instead of $datumizd ?
    $djelatnicitxt = GUICtrlRead($djelatnici)
    $vrijedidotxt = GUICtrlRead($vrijedido)
    FileWrite(@ScriptDir & "\izdane kartice\" & $brojkarttxt & "_" & $imeprezimetxt & ".txt", @CRLF & "PREZIME I IME:   " & $imeprezimetxt & @CRLF & "ADRESA:       " & $adresatxt & @CRLF & "MJESTO:       " & $postatxt & " " & $gradtxt & @CRLF & "BROJ KARTICE: " & $brojkarttxt & @CRLF & "KARTICA IZDANA: " & $datumizdtxt & @CRLF & "VRIJEDI DO: " & $vrijedidotxt & @CRLF & @CRLF & "DJELATNICA:    " & $djelatnicitxt)
    MsgBox(4096, "Podatci", "Podatci spremljeni u txt file pod imenom:" & @CRLF & $brojkarttxt & "_" & $imeprezimetxt & ".txt")
EndFunc   ;==>spremi1

Func izdane1()

;~  MsgBox(4,"Pregled izdanih kartica","#Region --- CodeWizard generated code Start ---
    ;MsgBox features: Title=Yes, Text=Yes, Buttons=Yes and No, Icon=Question
    If Not IsDeclared("iMsgBoxAnswer") Then Local $iMsgBoxAnswer
    $iMsgBoxAnswer = MsgBox(36,"Pregled izdanih kartica","Da li zelite otvoriti direktorij u kojem se nalaze izdane kartice?")
    Select
        Case $iMsgBoxAnswer = 6 ;Yes
            Run("Explorer.exe " & @ScriptDir & "\izdane kartice")
        Case $iMsgBoxAnswer = 7 ;No
            Sleep(100)
    EndSelect
#EndRegion --- CodeWizard generated code End ---

EndFunc   ;==>izdane1

Func izlaz1()
    Exit
EndFunc   ;==>izlaz1

:)

  • Like 1

Share this post


Link to post
Share on other sites
trancexx

Small language remark dickjones (dabl ou sevn), you wouldn't want to say: "Da li zelite otvoriti direktorij u kojem se nalaze izdane kartice?", what you should be saying is: "Zelite li otvoriti mapu s izdanim karticama?" 

  • Like 1

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
dickjones007

thank you MHz

hvala trancexx

Share this post


Link to post
Share on other sites
dickjones007

further for my app i would need to have input field for phone number in following format

000/000-0000

so is it possible to make something that will automatically put / after entering first 000 and then - after second 000

Edited by dickjones007

Share this post


Link to post
Share on other sites
dickjones007

anyone please?

Share this post


Link to post
Share on other sites
Melba23

dickjones007,

This ought to give you some ideas: ;)

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>

Global $aControl[4][2] = [[3, 0], [0, 3], [0, 3], [0, 4]]

$hGUI = GUICreate("Test", 200, 100)

For $i = 1 To 3
    $aControl[$i][0] = GUICtrlCreateInput("", (60 * $i) - 40, 20, $aControl[$i][1] * 10, 20)
    GUICtrlSetLimit(-1, $aControl[$i][1])
Next
$cFire_Dummy = GUICtrlCreateDummy()

GUIRegisterMsg($WM_COMMAND, "On_WM_COMMAND")

GUISetState()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $cFire_Dummy
            $sString = GUICtrlRead($aControl[1][0]) & "/" & GUICtrlRead($aControl[2][0]) & "-" & GUICtrlRead($aControl[3][0])
            MsgBox(0, "Result", $sString)
    EndSwitch
WEnd

Func On_WM_COMMAND($hWnd, $Msg, $wParam, $lParam)

    #forceref $hWnd, $Msg, $lParam

    $iCode = BitShift($wParam, 16)
    $iID = BitAND($wParam, 0x0000FFFF)
    For $iIndex = 1 To 3
        If $iID = $aControl[$iIndex][0] Then
            ExitLoop
        EndIf
    Next

    Switch $iCode
        Case $EN_UPDATE ; 0x400 ;
            If StringLen(GUICtrlRead($aControl[$iIndex][0])) = $aControl[$iIndex][1] Then
                If $iIndex = 3 Then
                    GUICtrlSendToDummy($cFire_Dummy)
                Else
                    GUICtrlSetState($aControl[$iIndex + 1][0], $GUI_ENABLE)
                    GUICtrlSetState($aControl[$iIndex + 1][0], $GUI_FOCUS)
                EndIf
            EndIf
    EndSwitch

EndFunc   ;==>On_WM_COMMAND
Please ask if you have any questions. :)

M23


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______Open Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
dickjones007

very useful

thank you so much

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×