autoitaddicted Posted December 15, 2011 Posted December 15, 2011 I'm using the code below for choosing city and then choosing district but i realized that even i didn't choose anything it still changes combo boxes, considering it will connected to a online sql db, it can be blocked easily because of sending too much requests. So, how can i fix that code i need a combo-box affects other combo-box only when i clicked on it not just mouse hover.. any help will be appreciated #include <GUIConstantsEx.au3> #include <GuiListView.au3> GUICreate("My GUI combo",250,150) $_Combo_Ilce =GUICtrlCreateCombo("İlçe Seçiniz", 10, 10, 200) For $n = 1 To 10 GUICtrlSetData($_Combo_Ilce, "İlçe " & $n) Next $_Button = GUICtrlCreateButton ( 'Select', 20, 70 ) GUISetState() $_ReadOld='' $_Combo_Mahalle = GUICtrlCreateCombo("Mahalle Seçiniz", 10, 50, 200) While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE ExitLoop Case $_Button ConsoleWrite ( "+->-- Select : " & GUICtrlRead ( $_Combo_Ilce ) & @Crlf ) EndSwitch $_Read = GUICtrlRead ( $_Combo_Ilce ) If $_Read <> $_ReadOld and $_Read<>"İlçe Seçiniz" Then GUICtrlSetData($_Combo_Mahalle, "","") GUICtrlSetData($_Combo_Mahalle,"Mahalle Seçiniz","Mahalle Seçiniz") For $n = 1 To 10 GUICtrlSetData($_Combo_Mahalle, &$_Read " Mahalle " & $n) Next ConsoleWrite ( "-->-- $_Read : " & $_Read & @Crlf ) $_ReadOld = $_Read EndIf WEnd
autoitaddicted Posted December 15, 2011 Author Posted December 15, 2011 ok did that: #include <GUIConstantsEx.au3> #include <GuiListView.au3> GUICreate("My GUI combo",250,150) $_Combo_Ilce =GUICtrlCreateCombo("İlçe Seçiniz", 10, 10, 200) For $n = 1 To 10 GUICtrlSetData($_Combo_Ilce, "İlçe " & $n) Next $_Button = GUICtrlCreateButton ( 'Select', 20, 70 ) GUISetState() $_ReadOld='' $_Combo_Mahalle = GUICtrlCreateCombo("Mahalle Seçiniz", 10, 50, 200) While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE ExitLoop Case $_Button ConsoleWrite ( "+->-- Select : " & GUICtrlRead ( $_Combo_Ilce ) & @Crlf ) Case $_Combo_Ilce $_Read = GUICtrlRead ( $_Combo_Ilce ) ConsoleWrite ( "+->-- Clicked : " & $_Read & @Crlf ) GUICtrlSetData($_Combo_Mahalle, "","") GUICtrlSetData($_Combo_Mahalle,"Mahalle Seçiniz","Mahalle Seçiniz") For $n = 1 To 10 GUICtrlSetData($_Combo_Mahalle, &$_Read " Mahalle " & $n) Next ConsoleWrite ( "-->-- $_Read : " & $_Read & @Crlf ) $_ReadOld = $_Read EndSwitch $_Read = GUICtrlRead ( $_Combo_Ilce ) If $_Read <> $_ReadOld and $_Read<>"İlçe Seçiniz" Then ConsoleWrite ( "-->-- $_Read : " & $_Read & @Crlf ) $_ReadOld = $_Read EndIf WEnd
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now