mustafakara Posted April 19, 2010 Share Posted April 19, 2010 sevgili arkadaşlar combobox ve listbox ların içerisindeki ögelerin sıralamasını alfabetik olarak dizilmesini nasıl sağlayabiliriz aşşağıda ki örneği yada benzerini code: #AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #include <GUIListBox.au3> #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> #include <Constants.au3> Opt('MustDeclareVars', 1) $Debug_LB = False ; Check ClassName being passed to ListBox functions, set to True and use a handle to another control to see it work Global $hListBox _Main() Func _Main() Local $hGUI ; Create GUI $hGUI = GUICreate("(UDF Created) List Box Create", 400, 296) $hListBox = _GUICtrlListBox_Create($hGUI, "String upon creation", 2, 2, 396, 296) GUISetState() MsgBox(4160, "Information", "Adding Items") GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") ; Add files _GUICtrlListBox_BeginUpdate($hListBox) _GUICtrlListBox_ResetContent($hListBox) _GUICtrlListBox_InitStorage($hListBox, 100, 4096) _GUICtrlListBox_Dir($hListBox, @WindowsDir & "\win*.exe") _GUICtrlListBox_AddFile($hListBox, @WindowsDir & "\Notepad.exe") _GUICtrlListBox_Dir($hListBox, "", $DDL_DRIVES) _GUICtrlListBox_Dir($hListBox, "", $DDL_DRIVES, False) _GUICtrlListBox_EndUpdate($hListBox) ; Loop until user exits Do Until GUIGetMsg() = $GUI_EVENT_CLOSE EndFunc ;==>_Main Func WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam) #forceref $hWnd, $iMsg Local $hWndFrom, $iIDFrom, $iCode, $hWndListBox If Not IsHWnd($hListBox) Then $hWndListBox = GUICtrlGetHandle($hListBox) $hWndFrom = $ilParam $iIDFrom = BitAND($iwParam, 0xFFFF) ; Low Word $iCode = BitShift($iwParam, 16) ; Hi Word Switch $hWndFrom Case $hListBox, $hWndListBox Switch $iCode Case $LBN_DBLCLK ; Sent when the user double-clicks a string in a list box _DebugPrint("$LBN_DBLCLK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ "-->Code:" & @TAB & $iCode) ; no return value Case $LBN_ERRSPACE ; Sent when a list box cannot allocate enough memory to meet a specific request _DebugPrint("$LBN_ERRSPACE" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ "-->Code:" & @TAB & $iCode) ; no return value Case $LBN_KILLFOCUS ; Sent when a list box loses the keyboard focus _DebugPrint("$LBN_KILLFOCUS" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ "-->Code:" & @TAB & $iCode) ; no return value Case $LBN_SELCANCEL ; Sent when the user cancels the selection in a list box _DebugPrint("$LBN_SELCANCEL" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ "-->Code:" & @TAB & $iCode) ; no return value Case $LBN_SELCHANGE ; Sent when the selection in a list box has changed _DebugPrint("$LBN_SELCHANGE" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ "-->Code:" & @TAB & $iCode) ; no return value Case $LBN_SETFOCUS ; Sent when a list box receives the keyboard focus _DebugPrint("$LBN_SETFOCUS" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ "-->Code:" & @TAB & $iCode) ; no return value EndSwitch EndSwitch ; Proceed the default Autoit3 internal message commands. ; You also can complete let the line out. ; !!! But only 'Return' (without any value) will not proceed ; the default Autoit3-message in the future !!! Return $GUI_RUNDEFMSG EndFunc ;==>WM_COMMAND Func _DebugPrint($s_text) $s_text = StringReplace($s_text, @LF, @LF & "-->") ConsoleWrite("!===========================================================" & @LF & _ "+===========================================================" & @LF & _ "-->" & $s_text & @LF & _ "+===========================================================" & @LF) EndFunc ;==>_DebugPrint Link to comment Share on other sites More sharing options...
mustafakara Posted April 20, 2010 Author Share Posted April 20, 2010 SEVGİLİ ARKADAŞLAR BEN BAŞTA KENDİM OLMAK ÜZERE SANTRAL MEMURLARI İÇİN BİR TELEFON REHBERİ YAPMAYA ÇALIŞIYORUM BİR ÇOK NOKTASINI BAŞARDIM ANCAK .İNİ DOSYASINDAN KİŞİLERİ LİSTE HALİNDE GÖSTERİRKEN ALFABETİK SIRAYA GÖRE DEYİL BENİM KAYDETTİĞİM SIRAYA GÖRE LİSTELİYOR BUDA ARARKEN YADA SİLMEK İSTEDİĞİMİZDE BULMAKTA SIKINTI OLUYOR. BUNEDENDEN DOLAYI YA .İNİ DOSYASINA ALFABETİK SIRAYA GÖRE YAZDIRMAK GEREKİYOR YADA LİSTBOX VE COMBOBOX LARDA ALFABETİK OLARAK GÖRÜNMESİNİ SAĞLAMAK GEREKİYOR. BU KONUDA YARDIMCI OLAN ARKADAŞLAR OLURSA MEMNUN OLURUM. ÖRNEK AMACIYLA KODLARI YAZIYORUM SCRİPTİN BİR BÖLÜMÜNDE BU KODLARI KULLANDIM. CODE: #AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #include <GUIListBox.au3> #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> Opt('MustDeclareVars', 1) $Debug_LB = False Global $var _Main() Func _Main() Local $hListBox ; Create GUI GUICreate("List Box Add String", 400, 296) $hListBox = GUICtrlCreateList("", 2, 2, 396, 296, BitOR($WS_BORDER, $WS_VSCROLL, $LBS_NOTIFY, $LBS_DISABLENOSCROLL, $WS_HSCROLL)) GUISetState() _GUICtrlListBox_BeginUpdate($hListBox) $var = IniReadSectionNames(@ScriptDir & "\rehber.ini") For $i = 1 To $var[0] _GUICtrlListBox_InsertString($hListBox, $var[$i]) Next _GUICtrlListBox_UpdateHScroll($hListBox) _GUICtrlListBox_EndUpdate($hListBox) ; Loop until user exits Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>_Main Link to comment Share on other sites More sharing options...
Administrator sk8er_boi Posted April 20, 2010 Administrator Share Posted April 20, 2010 _ArraySort kullanarak sıralayabilirsin. AutoIT yardımında açıklayıcı bilgi var. Link to comment Share on other sites More sharing options...
MostWanted Posted April 20, 2010 Share Posted April 20, 2010 Ya da direk "_GUICtrlListBox_Sort" öyle yazıyor autoit forumlarında Örneği' de koyayım.. #AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #include <GUIListBox.au3> #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> Opt('MustDeclareVars', 1) $Debug_LB = False Global $var _Main() Func _Main() Local $hListBox ; Create GUI GUICreate("List Box Add String", 400, 296) $hListBox = GUICtrlCreateList("", 2, 2, 396, 296) GUISetState() _GUICtrlListBox_BeginUpdate($hListBox) $var = IniReadSectionNames(@ScriptDir & "\rehber.ini") For $i = 1 To $var[0] _GUICtrlListBox_addString($hListBox, $var[$i]) Next _GUICtrlListBox_UpdateHScroll($hListBox) _GUICtrlListBox_EndUpdate($hListBox) MsgBox(0, "","sonraki hal") _GUICtrlListBox_Sort($hListBox) ; Loop until user exits Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc;==>_Main[/CODE] Link to comment Share on other sites More sharing options...
mustafakara Posted April 20, 2010 Author Share Posted April 20, 2010 sevgili arkadaşlar çok teşekkür ederim özellikle örnek için çok işime yaradı allah razı olsun. lakin bir sorum daha olacak. önce inidosyasını veriyorum. [mehmet] tel=0 333 333 33 33 burada input box a 0 333 333 33 33 yazarak bul dediğimizde farklı 1 inputbox ta nasıl mehmet cevabını alırım. saygılar sunuyorum sizlerin sayesinde bu işleri öğrendim tekrardan allah razı olsun. Link to comment Share on other sites More sharing options...
MostWanted Posted April 20, 2010 Share Posted April 20, 2010 #AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #include <GUIListBox.au3> #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> Opt('MustDeclareVars', 1) $Debug_LB = False Global $var, $var2, $numara, $isim, $button _Main() Func _Main() Local $hListBox ; Create GUI GUICreate("List Box Add String", 400, 296) $hListBox = GUICtrlCreateList("", 2, 2, 386, 276) $numara=GUICtrlCreateInput("", 2,269, 100, 20) $isim=GUICtrlCreateInput("", 190,269, 100, 20) $button=GUICtrlCreateButton("Ara", 120, 269, 60, 20) GUISetState() _GUICtrlListBox_BeginUpdate($hListBox) $var = IniReadSectionNames(@ScriptDir & "\rehber.ini") For $i = 1 To $var[0] _GUICtrlListBox_addString($hListBox, $var[$i]) Next _GUICtrlListBox_UpdateHScroll($hListBox) _GUICtrlListBox_EndUpdate($hListBox) MsgBox(0, "","sonraki hal") _GUICtrlListBox_Sort($hListBox) ; Loop until user exits Do If GUIGetMsg() = $button Then GUICtrlSetData($isim, bul(GuiCtrlRead($numara))) EndIf Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc;==>_Main Func bul($numara) $var = IniReadSectionNames(@ScriptDir & "\rehber.ini") For $i = 1 To $var[0] $var2 = IniReadSection(@ScriptDir & "\rehber.ini", $var[$i]) for $j = 1 to $var2[0][0] If $var2[$j][1] = $numara Then Return $var[$i] EndIf Next Next EndFunc[/CODE] Soldaki kutucuğa numarayı yazıp ara dediğinde sağdaki kutucukta kime ait olduğu ismi görünecektir. Link to comment Share on other sites More sharing options...
mustafakara Posted April 21, 2010 Author Share Posted April 21, 2010 arkadaşım tekrar tekrar teşekkür ederim mesayim bittiği için ancak şimdi bakabildim oyüzden şimdi cevap verebildim sizler gibi paylaşımcı insanların olması. inanın beni çok mutlu etti duygulandırdı. emeğinize, yüreğinize ve ellerinize sağlık. affınıza sığınarak son bir soru sormak istiyorum şimdilik yukarıdaki örneklerin combobox hali nasıl baktım ama bulamadım. combobox ta alfabetik sıralama nasıl mümkün olur tekrar saygılar. Link to comment Share on other sites More sharing options...
mustafakara Posted April 21, 2010 Author Share Posted April 21, 2010 arkadaşlar aşağıdaki örnekte alfabetik sıralama nasıl yapılabilir combo box liste düzeni alfabetik olacak. code: #AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #include <GUIComboBox.au3> #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> Opt('MustDeclareVars', 1) $Debug_LB = False Global $var _Main() Func _Main() Local $hCombo ; Create GUI GUICreate("alfabetik sralama", 400, 296) $hCombo= GUICtrlCreateCombo("", 2, 2, 396, 296) GUISetState() _GUICtrlComboBox_BeginUpdate($hCombo) $var = IniReadSectionNames(@ScriptDir & "\rehber.ini") For $i = 1 To $var[0] _GUICtrlComboBox_AddString($hCombo, $var[$i], 0) _GUICtrlComboBox_AddString($hCombo, $var[$i]) Next _GUICtrlComboBox_EndUpdate($hCombo) ; Loop until user exits Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>_Main Link to comment Share on other sites More sharing options...
MostWanted Posted April 21, 2010 Share Posted April 21, 2010 Listbox da kendi sort komutu vardı ama comboboxta bu olmadığı için sk8er_boi'nin dediği komutu kullanacaz yani _arraysort . Aşağıda küçük bi örnek gösterdim hata ayarlamalarını falan artık sen yaparsın #AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #include <GUIComboBox.au3> #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> #Include <Array.au3> Global $var, $Debug_LB $Debug_LB = False _Main() Func _Main() Local $hCombo ; Create GUI GUICreate("alfabetik sralama", 400, 296) $hCombo= GUICtrlCreateCombo("", 2, 2, 396, 296) GUISetState() $var = IniReadSectionNames(@ScriptDir & "\rehber.ini") _ArraySort($var) For $i = 1 To $var[0] _GUICtrlComboBox_AddString($hCombo, $var[$i]) Next ; Loop until user exits Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc;==>_Main[/CODE] Link to comment Share on other sites More sharing options...
blue_life Posted April 21, 2010 Share Posted April 21, 2010 @mustafakara Bir önrnekte benden olsun Başlangıçtaki inwirite satırlarını silersin... http://www.4shared.com/file/wYNR3s5P/Telefon_Rehberi.html[/CODE] Link to comment Share on other sites More sharing options...
mustafakara Posted April 21, 2010 Author Share Posted April 21, 2010 ARKADAŞLAR TEKRAR TEŞEKKÜRLER ÖRNEK: _GUICtrlComboBox_BeginUpdate($hCombo) $var = IniReadSectionNames(@ScriptDir & "\rehber.ini") _ArraySort($var) For $i = 1 To $var[0] _GUICtrlComboBox_AddString($hCombo, $var[$i]) Next _GUICtrlComboBox_EndUpdate($hCombo) BU KODLARI FARKLI SCRİPLERDE DENEDİĞİM ZAMAN ÇALIŞIYOR LAKİN KENDİ SCRİPTİMDE COMBOBOX BOŞ NEDEN KAYNAKLANABİLİR SİZCE Link to comment Share on other sites More sharing options...
MostWanted Posted April 21, 2010 Share Posted April 21, 2010 Sence biz bunu senin scriptini görmeden nasıl anlayabiliriz? Ama bi ihtimal combolarar atadığı değişkenden olabilir diyecem.. Link to comment Share on other sites More sharing options...
mustafakara Posted April 21, 2010 Author Share Posted April 21, 2010 talha_252 kardeşim dünden beri bana yardımcı oluyorsun başta sen ve diyer arkadaşlar hepiniz sağolun işte scriptim incelerseniz sevinirim code: Please register to see this content. kendi çapımda birşeyler yapmaya çalışıyorum farlar az yanınca ancak bukadar oluyor tabi siz deyerli arkadaşlar sayesinde birşeyler yapmaya çalışıyoruz incelerseniz sevinirim. teşekkürler. Link to comment Share on other sites More sharing options...
mustafakara Posted April 22, 2010 Author Share Posted April 22, 2010 arkadaşlar merhabalar ben bu combobox te harf sırasına göre listeleme işlemini birtürlü yapamadım. _ArraySort($var) bu satırı eklediğimanda combobox taki liste ve otomatik tamamlama işlemi kayboluyor farklı scriptte denediğimde liste ve otomatik tamamlama oluyor sizce nerrede yanlışlık var? teş code GUICreate("TELEFON REHBERİ", 800, 600,-1, -1, BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_MAXIMIZEBOX)) GUISetBkColor(0x00E0F000) GUISetFont(9, 300) $tab = GUICtrlCreateTab(77, 5, 577, 25) $tab0 = GUICtrlCreateTabItem("Kayıt bul") GUICtrlSetState(-1, $GUI_SHOW) $goruntu = GUICtrlCreatePic($resm, 620, 50, 140, 190) GUICtrlCreateLabel("aramak istediğiniz kişinin adı:", 295, 460) $hCombo = GUICtrlCreateCombo("", 200, 480, 390, 100) GUICtrlSetFont($hCombo, 14) $taB0OK = GUICtrlCreateButton("BUL", 277, 530, 225, 40) GUICtrlSetFont($taB0OK, 20) $tab0lad1 = GUICtrlCreateLabel("Telefon numarası 1", 100, 380) $tab0Input1 = GUICtrlCreateInput("", 27, 400, 225, 30) GUICtrlSetFont($tab0Input1, 15) $tab0lad2 = GUICtrlCreateLabel("TELEFON NUMARASI 2", 340, 380) $tab0Input2 = GUICtrlCreateInput("", 279, 400, 225, 30) GUICtrlSetFont($tab0Input2, 15) $tab0lad3 = GUICtrlCreateLabel("TELEFON NUMARASI 3", 600, 380) $tab0Input3 = GUICtrlCreateInput("", 534, 400, 225, 30) GUICtrlSetFont($tab0Input3, 15) $tab1 = GUICtrlCreateTabItem("Kayıt ekle") $tab1lad = GUICtrlCreateLabel("ADI SOYADI:", 330, 230,225, 30) GUICtrlSetFont($tab1lad, 12) $tab1Input = GUICtrlCreateInput("", 279, 250, 225, 30) GUICtrlSetFont($tab1Input, 14) GUICtrlCreateLabel("Kayıt türü", 100, 335) $tab1TUR1 = GUICtrlCreateList("", 28, 350,225, 40) $tab1lad1 = GUICtrlCreateLabel("ADI:", 27, 380,225, 20) GUICtrlSetFont($tab1lad1, 13) $tab1Input1 = GUICtrlCreateInput("", 27, 400, 225, 30) GUICtrlSetFont($tab1Input1, 14) GUICtrlCreateLabel("Kayıt türü", 349, 335) $tab1TUR2 = GUICtrlCreateList("", 279, 350,225, 40) $tab1lad2 = GUICtrlCreateLabel("telefon numarası:", 280, 380,225, 20) GUICtrlSetFont($tab1lad2, 13) $tab1Input2 = GUICtrlCreateInput("", 279, 400, 225, 30) GUICtrlSetFont($tab1Input2, 14) GUICtrlCreateLabel("Kayıt türü", 604, 335) $tab1TUR3 = GUICtrlCreateList("", 534, 350,225, 40) $tab1lad3 = GUICtrlCreateLabel("faks numarası:", 535, 380,225, 20) GUICtrlSetFont($tab1lad3, 13) $tab1Input3 = GUICtrlCreateInput("", 534, 400, 225, 30) GUICtrlSetFont($tab1Input3, 14) $tab1lad4 = GUICtrlCreateLabel("KAN GURUBU", 290, 435,225, 20) GUICtrlSetFont($tab1lad3, 13) $tab1kan = GUICtrlCreateList("", 279, 455,225, 40) GUICtrlSetData(-1, "0 RH +|A RH +|B RH +|A B RH +|0 RH -|A RH -|B RH -|A B RH -","") $tab1OK = GUICtrlCreateButton("REHBERE EKLE", 277, 530, 225, 40) GUICtrlSetFont($tab1OK, 20) $tab2 = GUICtrlCreateTabItem("KAN GURUPLARI") $tab3 = GUICtrlCreateTabItem("KAYIT DÜZENLE") $tab4 = GUICtrlCreateTabItem("Kayıt sil") $tab4kay = GUICtrlCreateLabel("KAYIT SİLME LİSTESİ:", 100, 90,300,26) GUICtrlSetFont($tab4kay, 18) $tab4list = GUICtrlCreateList("", 50, 120, 400, 350) GUICtrlSetFont($tab4list, 15) $tab4OK = GUICtrlCreateButton("SİL", 277, 540, 225, 40) $tab4lad1 = GUICtrlCreateLabel("", 50,460, 690, 18) GUICtrlSetFont($tab4lad1, 14) $tab4lad2 = GUICtrlCreateLabel("",50, 482, 690, 18) GUICtrlSetFont($tab4lad2, 14) $tab4lad3 = GUICtrlCreateLabel("",50, 503, 690, 18) GUICtrlSetFont($tab4lad3, 14) $tab5 = GUICtrlCreateTabItem("AYARLAR") $goruntu1 = GUICtrlCreatePic("", 620, 50, 140, 190) $tab5lad1 = GUICtrlCreateLabel("KULLANICI ADI:",55, 80,130, 20) GUICtrlSetFont($tab5lad1, 13) $tab5Input1 = GUICtrlCreateInput("", 25, 100, 225, 20) $tab5lad2 = GUICtrlCreateLabel("KULLANICI PAROLASI:",55, 130,300, 20) GUICtrlSetFont($tab5lad2, 13) $tab5Input2 = GUICtrlCreateInput("", 25, 150, 225, 20) $tab5b0 = GUICtrlCreateButton("RESMİMİ DEĞİŞTİR", 615, 80,150, 40) $tab5lad3 = GUICtrlCreateLabel("TÜRLER:",605, 320,225, 40) GUICtrlSetFont($tab5lad2, 13) $tab5TUR = GUICtrlCreateCombo("", 525, 350,225, 40) $tab5b1 = GUICtrlCreateButton("TÜRÜ EKLE", 525, 390,90, 20) $tab5b2 = GUICtrlCreateButton("TÜRÜ SİL", 640, 390,90, 20) $tab6 = GUICtrlCreateTabItem("GENEL BİLGİLER") FileInstall("res.tmp",@TempDir & "\res.tmp") GUICtrlCreatePic(@TempDir & "\res.tmp", 680, 50, 70, 120) GUICtrlCreateTabItem("") GUISetState() _GUICtrlComboBox_BeginUpdate($hCombo) $var = IniReadSectionNames(@ScriptDir & "\rehber.ini") _ArraySort($var) For $i = 1 To $var[0] _GUICtrlComboBox_AddString($hCombo, $var[$i]) Next _GUICtrlComboBox_EndUpdate($hCombo) _GUICtrlListBox_BeginUpdate($tab1TUR1) $AYAR1 = IniReadSection("DEFAULT.ini", "TURLER") _ArraySort($AYAR1) For $i = 1 To $AYAR1[0][0] _GUICtrlListBox_addString($tab1TUR1, $AYAR1[$i][0]) Next _GUICtrlListBox_EndUpdate($tab1TUR1) _GUICtrlListBox_BeginUpdate($tab1TUR2) $AYAR1 = IniReadSection("DEFAULT.ini", "TURLER") _ArraySort($AYAR1) For $i = 1 To $AYAR1[0][0] _GUICtrlListBox_addString($tab1TUR2, $AYAR1[$i][0]) Next _GUICtrlListBox_EndUpdate($tab1TUR2) _GUICtrlListBox_BeginUpdate($tab1TUR3) $AYAR1 = IniReadSection("DEFAULT.ini", "TURLER") _ArraySort($AYAR1) For $i = 1 To $AYAR1[0][0] _GUICtrlListBox_addString($tab1TUR3, $AYAR1[$i][0]) Next _GUICtrlListBox_EndUpdate($tab1TUR3) _GUICtrlListBox_BeginUpdate($tab4list) $var = IniReadSectionNames("rehber.ini") For $i = 1 To $var[0] _GUICtrlListBox_addString($tab4list, $var[$i]) Next _GUICtrlListBox_EndUpdate($tab4list) _GUICtrlComboBox_BeginUpdate($tab5TUR) $AYAR1 = IniReadSection("DEFAULT.ini", "TURLER") _ArraySort($AYAR1) For $i = 1 To $AYAR1[0][0] _GUICtrlComboBox_AddString($tab5TUR, $AYAR1[$i][0]) Next _GUICtrlComboBox_EndUpdate($tab5TUR) GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") While 1 Link to comment Share on other sites More sharing options...
djonur007 Posted April 22, 2010 Share Posted April 22, 2010 arkdaşım #include'ler nerede? bu tür (_GUICtrlComboBox_AddString) şeyleri kullanabilmen için bunların include'lerini girmen gerek. verdiğin kodlarda bunlar yok. ayırıca şu kodları CODE içine alırsan ok daha iyi olacak. Link to comment Share on other sites More sharing options...
mustafakara Posted April 22, 2010 Author Share Posted April 22, 2010 teşekkürler öncelikle yer kaplamasın diye kısaca bazı bölümleri yazmıştım işte tamamı. code: #AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #include <GUIComboBox.au3> #include <GUIListBox.au3> #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiTab.au3> #Include <Array.au3> Opt('MustDeclareVars', 1) $Debug_CB = False Global $mesaj Global $mesaj1 Global $mesaj2 Global $mesaj3 Global $goruntu Global $b Global $resm Global $nMsg Global $AYAR Global $AYAR1 Global $AYAR2 Global $dosya Global $hCombo Global $var Global $onay Global $i Global $tab Global $tab0 Global $tab0OK Global $tab0Input1 Global $tab0Input2 Global $tab0input3 Global $tab0lad Global $tab0lad1 Global $tab0lad2 Global $tab0lad3 Global $tab1 Global $tab1Input Global $tab1Input1 Global $tab1Input2 Global $tab1Input3 Global $tab1combo Global $tab1OK Global $tab1lad Global $tab1lad1 Global $tab1lad2 Global $tab1lad3 Global $tab1lad4 Global $tab1TUR1 Global $tab1TUR2 Global $tab1TUR3 Global $tab1kan Global $tab2 Global $tab3 Global $tab4 Global $tab4list Global $tab4kay Global $tab4OK Global $tab4lad Global $tab4lad1 Global $tab4lad2 Global $tab4lad3 Global $tab5 Global $tab5lad1 Global $tab5lad2 Global $tab5lad3 Global $tab5lad4 Global $goruntu1 Global $tab5Input1 Global $tab5Input2 Global $tab5TUR Global $tab5b0 Global $tab5b1 Global $tab5b2 Global $AYAR2 Global $resmlist Global $tab6 $mesaj3 ="resim seç:" $AYAR = "DEFAULT.ini" $dosya = "rehber.ini" ;;$var = IniReadSectionNames("rehber.ini") $resm = IniRead($AYAR,"ayarlar", "resim", "") IniReadSectionNames($dosya) If @error Then MsgBox(4096, "", "rehbere ait olan ini dosyası, yok yada boş.") Else _Main() EndIf Func _Main() GUICreate("TELEFON REHBERİ", 800, 600,-1, -1, BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_MAXIMIZEBOX)) GUISetBkColor(0x00E0F000) GUISetFont(9, 300) $tab = GUICtrlCreateTab(77, 5, 577, 25) $tab0 = GUICtrlCreateTabItem("Kayıt bul") GUICtrlSetState(-1, $GUI_SHOW) $goruntu = GUICtrlCreatePic($resm, 620, 50, 140, 190) GUICtrlCreateLabel("aramak istediğiniz kişinin adı:", 295, 460) $hCombo = GUICtrlCreateCombo("", 200, 480, 390, 100) GUICtrlSetFont($hCombo, 14) $taB0OK = GUICtrlCreateButton("BUL", 277, 530, 225, 40) GUICtrlSetFont($taB0OK, 20) $tab0lad1 = GUICtrlCreateLabel("Telefon numarası 1", 100, 380) $tab0Input1 = GUICtrlCreateInput("", 27, 400, 225, 30) GUICtrlSetFont($tab0Input1, 15) $tab0lad2 = GUICtrlCreateLabel("TELEFON NUMARASI 2", 340, 380) $tab0Input2 = GUICtrlCreateInput("", 279, 400, 225, 30) GUICtrlSetFont($tab0Input2, 15) $tab0lad3 = GUICtrlCreateLabel("TELEFON NUMARASI 3", 600, 380) $tab0Input3 = GUICtrlCreateInput("", 534, 400, 225, 30) GUICtrlSetFont($tab0Input3, 15) $tab1 = GUICtrlCreateTabItem("Kayıt ekle") $tab1lad = GUICtrlCreateLabel("ADI SOYADI:", 330, 230,225, 30) GUICtrlSetFont($tab1lad, 12) $tab1Input = GUICtrlCreateInput("", 279, 250, 225, 30) GUICtrlSetFont($tab1Input, 14) GUICtrlCreateLabel("Kayıt türü", 100, 335) $tab1TUR1 = GUICtrlCreateList("", 28, 350,225, 40) $tab1lad1 = GUICtrlCreateLabel("ADI:", 27, 380,225, 20) GUICtrlSetFont($tab1lad1, 13) $tab1Input1 = GUICtrlCreateInput("", 27, 400, 225, 30) GUICtrlSetFont($tab1Input1, 14) GUICtrlCreateLabel("Kayıt türü", 349, 335) $tab1TUR2 = GUICtrlCreateList("", 279, 350,225, 40) $tab1lad2 = GUICtrlCreateLabel("telefon numarası:", 280, 380,225, 20) GUICtrlSetFont($tab1lad2, 13) $tab1Input2 = GUICtrlCreateInput("", 279, 400, 225, 30) GUICtrlSetFont($tab1Input2, 14) GUICtrlCreateLabel("Kayıt türü", 604, 335) $tab1TUR3 = GUICtrlCreateList("", 534, 350,225, 40) $tab1lad3 = GUICtrlCreateLabel("faks numarası:", 535, 380,225, 20) GUICtrlSetFont($tab1lad3, 13) $tab1Input3 = GUICtrlCreateInput("", 534, 400, 225, 30) GUICtrlSetFont($tab1Input3, 14) $tab1lad4 = GUICtrlCreateLabel("KAN GURUBU", 290, 435,225, 20) GUICtrlSetFont($tab1lad3, 13) $tab1kan = GUICtrlCreateList("", 279, 455,225, 40) GUICtrlSetData(-1, "0 RH +|A RH +|B RH +|A B RH +|0 RH -|A RH -|B RH -|A B RH -","") $tab1OK = GUICtrlCreateButton("REHBERE EKLE", 277, 530, 225, 40) GUICtrlSetFont($tab1OK, 20) $tab2 = GUICtrlCreateTabItem("KAN GURUPLARI") $tab3 = GUICtrlCreateTabItem("KAYIT DÜZENLE") $tab4 = GUICtrlCreateTabItem("Kayıt sil") $tab4kay = GUICtrlCreateLabel("KAYIT SİLME LİSTESİ:", 100, 90,300,26) GUICtrlSetFont($tab4kay, 18) $tab4list = GUICtrlCreateList("", 50, 120, 400, 350) GUICtrlSetFont($tab4list, 15) $tab4OK = GUICtrlCreateButton("SİL", 277, 540, 225, 40) $tab4lad1 = GUICtrlCreateLabel("", 50,460, 690, 18) GUICtrlSetFont($tab4lad1, 14) $tab4lad2 = GUICtrlCreateLabel("",50, 482, 690, 18) GUICtrlSetFont($tab4lad2, 14) $tab4lad3 = GUICtrlCreateLabel("",50, 503, 690, 18) GUICtrlSetFont($tab4lad3, 14) $tab5 = GUICtrlCreateTabItem("AYARLAR") $goruntu1 = GUICtrlCreatePic("", 620, 50, 140, 190) $tab5lad1 = GUICtrlCreateLabel("KULLANICI ADI:",55, 80,130, 20) GUICtrlSetFont($tab5lad1, 13) $tab5Input1 = GUICtrlCreateInput("", 25, 100, 225, 20) $tab5lad2 = GUICtrlCreateLabel("KULLANICI PAROLASI:",55, 130,300, 20) GUICtrlSetFont($tab5lad2, 13) $tab5Input2 = GUICtrlCreateInput("", 25, 150, 225, 20) $tab5b0 = GUICtrlCreateButton("RESMİMİ DEĞİŞTİR", 615, 80,150, 40) $tab5lad3 = GUICtrlCreateLabel("TÜRLER:",605, 320,225, 40) GUICtrlSetFont($tab5lad2, 13) $tab5TUR = GUICtrlCreateCombo("", 525, 350,225, 40) $tab5b1 = GUICtrlCreateButton("TÜRÜ EKLE", 525, 390,90, 20) $tab5b2 = GUICtrlCreateButton("TÜRÜ SİL", 640, 390,90, 20) $tab6 = GUICtrlCreateTabItem("GENEL BİLGİLER") FileInstall("res.tmp",@TempDir & "\res.tmp") GUICtrlCreatePic(@TempDir & "\res.tmp", 680, 50, 70, 120) GUICtrlCreateTabItem("") GUISetState() _GUICtrlComboBox_BeginUpdate($hCombo) $var = IniReadSectionNames(@ScriptDir & "\rehber.ini") _ArraySort($var) For $i = 1 To $var[0] _GUICtrlComboBox_AddString($hCombo, $var[$i]) Next _GUICtrlComboBox_EndUpdate($hCombo) _GUICtrlListBox_BeginUpdate($tab1TUR1) $AYAR1 = IniReadSection("DEFAULT.ini", "TURLER") _ArraySort($AYAR1) For $i = 1 To $AYAR1[0][0] _GUICtrlListBox_addString($tab1TUR1, $AYAR1[$i][0]) Next _GUICtrlListBox_EndUpdate($tab1TUR1) _GUICtrlListBox_BeginUpdate($tab1TUR2) $AYAR1 = IniReadSection("DEFAULT.ini", "TURLER") _ArraySort($AYAR1) For $i = 1 To $AYAR1[0][0] _GUICtrlListBox_addString($tab1TUR2, $AYAR1[$i][0]) Next _GUICtrlListBox_EndUpdate($tab1TUR2) _GUICtrlListBox_BeginUpdate($tab1TUR3) $AYAR1 = IniReadSection("DEFAULT.ini", "TURLER") _ArraySort($AYAR1) For $i = 1 To $AYAR1[0][0] _GUICtrlListBox_addString($tab1TUR3, $AYAR1[$i][0]) Next _GUICtrlListBox_EndUpdate($tab1TUR3) _GUICtrlListBox_BeginUpdate($tab4list) $var = IniReadSectionNames("rehber.ini") For $i = 1 To $var[0] _GUICtrlListBox_addString($tab4list, $var[$i]) Next _GUICtrlListBox_EndUpdate($tab4list) _GUICtrlComboBox_BeginUpdate($tab5TUR) $AYAR1 = IniReadSection("DEFAULT.ini", "TURLER") _ArraySort($AYAR1) For $i = 1 To $AYAR1[0][0] _GUICtrlComboBox_AddString($tab5TUR, $AYAR1[$i][0]) Next _GUICtrlComboBox_EndUpdate($tab5TUR) GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE FileDelete(@TempDir & "\res.tmp") Exit Case $taB0OK IniReadSection( $dosya, GUICtrlRead($hCombo)) If @error Then MsgBox(4144, "Kayıt BUL:","REHBERDE:" & @LF & GUICtrlRead($hCombo) & @LF & "adında kayıt mevcut deyil," & @LF & "lütfen başka bir isimle aramayı deneyin.") Else GUICtrlSetData( $tab0lad1, IniRead($dosya, GUICtrlRead($hCombo), "tur1", "")) GUICtrlSetData( $tab0Input1, IniRead($dosya, GUICtrlRead($hCombo), "tel1", "")) GUICtrlSetData( $tab0lad2, IniRead($dosya, GUICtrlRead($hCombo), "tur2", "")) GUICtrlSetData( $tab0Input2, IniRead($dosya, GUICtrlRead($hCombo), "tel2", "")) GUICtrlSetData( $tab0lad3, IniRead($dosya, GUICtrlRead($hCombo), "tur3", "")) GUICtrlSetData( $tab0Input3, IniRead($dosya, GUICtrlRead($hCombo), "tel3", "")) EndIf Case $tab1TUR1 GUICtrlSetData( $tab1lad1, GUICtrlRead($tab1TUR1)) Case $tab1TUR2 GUICtrlSetData( $tab1lad2, GUICtrlRead($tab1TUR2)) Case $tab1TUR3 GUICtrlSetData( $tab1lad3, GUICtrlRead($tab1TUR3)) Case $tab1OK IniReadSection( $dosya, GUICtrlRead($tab1Input)) If @error Then IniWrite($dosya, GUICtrlRead($tab1Input),"tur1", GUICtrlRead($tab1TUR1)) IniWrite($dosya, GUICtrlRead($tab1Input),"tel1", GUICtrlRead($tab1Input1)) IniWrite($dosya, GUICtrlRead($tab1Input),"tur2", GUICtrlRead($tab1TUR2)) IniWrite($dosya, GUICtrlRead($tab1Input),"tel2", GUICtrlRead($tab1Input2)) IniWrite($dosya, GUICtrlRead($tab1Input),"tur3", GUICtrlRead($tab1TUR3)) IniWrite($dosya, GUICtrlRead($tab1Input),"tel3", GUICtrlRead($tab1Input3)) Else MsgBox(4144, "Kayıt ekle:","REHBERDE:" & @LF & GUICtrlRead($tab1Input) & @LF & "adında kayıt mevcut, lütfen başka bir isimle kaydedin") EndIf Case $tab4list GUICtrlSetData( $tab4lad1, IniRead($dosya, GUICtrlRead($tab4list), "tur1", "") & " : " & IniRead($dosya, GUICtrlRead($tab4list), "tel1", "")) GUICtrlSetData( $tab4lad2, IniRead($dosya, GUICtrlRead($tab4list), "tur2", "") & " : " & IniRead($dosya, GUICtrlRead($tab4list), "tel2", "")) GUICtrlSetData( $tab4lad3, IniRead($dosya, GUICtrlRead($tab4list), "tur3", "") & " : " & IniRead($dosya, GUICtrlRead($tab4list), "tel3", "")) Case $tab4OK If GUICtrlRead($tab4list) = "" Then MsgBox(40000, "HATA", "Lütfen listeden silmek için bir seçim yapınız...") _GUICtrlListBox_ClickItem($tab4list, 0,"", True) Else sil() EndIf Case $tab5b1 IniWrite($AYAR,"turler", GUICtrlRead($tab5TUR),"") Case $tab5b2 IniDelete($AYAR,"turler",GUICtrlRead($tab5TUR)) Case $tab5b0 $resmlist = FileOpenDialog($mesaj3, "\*.jpg", "resim (*.jpg)|resim (*.bmp)", 1 + 1 ) If @error Then MsgBox(4096,"","dosya seçilmedi") Else MsgBox(4096,"","seçilen dosya:" & $resmlist) IniWrite(@ScriptDir & "\" & $AYAR ,"AYARLAR","resim",$resmlist) EndIf EndSwitch WEnd EndFunc ;==>_Main Func _Edit_Changed() _GUICtrlComboBox_AutoComplete($hCombo) EndFunc ;==>_Edit_Changed Func WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam) #forceref $hWnd, $iMsg Local $hWndFrom, $iIDFrom, $iCode, $hWndCombo If Not IsHWnd($hCombo) Then $hWndCombo = GUICtrlGetHandle($hCombo) $hWndFrom = $ilParam $iIDFrom = BitAND($iwParam, 0xFFFF) ; Low Word $iCode = BitShift($iwParam, 16) ; Hi Word Switch $hWndFrom Case $hCombo, $hWndCombo Switch $iCode Case $CBN_CLOSEUP ; Sent when the list box of a combo box has been closed _DebugPrint("$CBN_CLOSEUP" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ "-->Code:" & @TAB & $iCode) ; no return value Case $CBN_DBLCLK ; Sent when the user double-clicks a string in the list box of a combo box _DebugPrint("$CBN_DBLCLK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ "-->Code:" & @TAB & $iCode) ; no return value Case $CBN_DROPDOWN ; Sent when the list box of a combo box is about to be made visible _DebugPrint("$CBN_DROPDOWN" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ "-->Code:" & @TAB & $iCode) ; no return value Case $CBN_EDITCHANGE ; Sent after the user has taken an action that may have altered the text in the edit control portion of a combo box _DebugPrint("$CBN_EDITCHANGE" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ "-->Code:" & @TAB & $iCode) _Edit_Changed() ; no return value Case $CBN_EDITUPDATE ; Sent when the edit control portion of a combo box is about to display altered text _DebugPrint("$CBN_EDITUPDATE" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ "-->Code:" & @TAB & $iCode) ; no return value Case $CBN_ERRSPACE ; Sent when a combo box cannot allocate enough memory to meet a specific request _DebugPrint("$CBN_ERRSPACE" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ "-->Code:" & @TAB & $iCode) ; no return value Case $CBN_KILLFOCUS ; Sent when a combo box loses the keyboard focus _DebugPrint("$CBN_KILLFOCUS" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ "-->Code:" & @TAB & $iCode) ; no return value Case $CBN_SELCHANGE ; Sent when the user changes the current selection in the list box of a combo box _DebugPrint("$CBN_SELCHANGE" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ "-->Code:" & @TAB & $iCode) ; no return value Case $CBN_SELENDCANCEL ; Sent when the user selects an item, but then selects another control or closes the dialog box _DebugPrint("$CBN_SELENDCANCEL" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ "-->Code:" & @TAB & $iCode) ; no return value Case $CBN_SELENDOK ; Sent when the user selects a list item, or selects an item and then closes the list _DebugPrint("$CBN_SELENDOK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ "-->Code:" & @TAB & $iCode) ; no return value Case $CBN_SETFOCUS ; Sent when a combo box receives the keyboard focus _DebugPrint("$CBN_SETFOCUS" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ "-->Code:" & @TAB & $iCode) ; no return value EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_COMMAND Func _DebugPrint($s_text, $line = @ScriptLineNumber) ConsoleWrite( _ "!===========================================================" & @LF & _ "+======================================================" & @LF & _ "-->Line(" & StringFormat("%04d", $line) & "):" & @TAB & $s_text & @LF & _ "+======================================================" & @LF) EndFunc ;==>_DebugPrint Func sil() $onay = MsgBox(4,"KAYIT SİLİNİYOR:","REHBERDE: " & GUICtrlRead($tab4list)& " ADINDA BULUNAN KAYIT SİLİNECEKTİR. SİLMEK İSTEDİĞİNİZDEN EMİNMİSİNİZ?") If $onay = 6 Then IniDelete($dosya, GUICtrlRead($tab4list)) GUICtrlSetData( $tab4lad1,"") GUICtrlSetData( $tab4lad2,"") GUICtrlSetData( $tab4lad3,"") _GUICtrlListBox_ResetContent($tab4list) _GUICtrlListBox_BeginUpdate($tab4list) $var = IniReadSectionNames("rehber.ini") For $i = 1 To $var[0] _GUICtrlListBox_addString($tab4list, $var[$i]) Next _GUICtrlListBox_EndUpdate($tab4list) _GUICtrlListBox_ClickItem($tab4list, 0,"", True) ElseIf $onay = 7 Then EndIf EndFunc ;==>_sil Link to comment Share on other sites More sharing options...
mustafakara Posted April 22, 2010 Author Share Posted April 22, 2010 deyerli arkadaşlar aşağıdaki kodlarla dosyayı oluşturduğumda oluşturduğum dosya ve .ini dosyası c:\ ana dizindeyse çalışıyor ben bu dosyaları c:\rehber\ kılasörüne taşıdığımda comdobox boş hiçbirşey göstermiyor. _ArraySort($var) satırını çıkarttığımda normal fakat bu seferde alfabetik olarak sıralamıyor ne yapmam gerekiyor scriptimdeki sorun buymuş yardımcı olursanız sevinirim. teşekkürler code: #include <GUIComboBox.au3> #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> #Include <Array.au3> Opt('MustDeclareVars', 1) $Debug_CB = False Global $hCombo Global $var GUICreate("harfe göre sırala:", 400, 296) $hCombo = GUICtrlCreateCombo("", 2, 2, 396, 296) GUISetState() _GUICtrlComboBox_BeginUpdate($hCombo) $var = IniReadSectionNames( @ScriptDir & "\rehber.ini") _ArraySort($var) For $i = 1 To $var[0] _GUICtrlComboBox_AddString($hCombo, $var[$i]) Next _GUICtrlComboBox_EndUpdate($hCombo) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() Link to comment Share on other sites More sharing options...
blue_life Posted April 22, 2010 Share Posted April 22, 2010 @djonur007 Scite ekranında #include ile başlayan satıra tıklatıp Tools menüsünden Open Include seçeneğine basarak ilgili dosyayı açabilirsin. Tabi Alt + I klevye kısayol tuşunuda kullanabilirsin. @mustafakara Çalışman malesef çok düzensiz. Bir yerini yapsan bir yerden fire vercektir. Neyse sen comboboxu alfebetik sıraya göre içeriğini ayarlamak istiyorsun. O zaman aşağıdaki fonkisyonları script dosyanın sonuna ekle. Func _Update_ComboBox(ByRef $COMBO_ID,$GET_ARRAY) Local $1,$Value,$Value1 If not UBound($GET_ARRAY) Then Return SetError(1) For $1 = 0 To UBound($GET_ARRAY) -1 $Value &= $GET_ARRAY[$1] & "|" If $Value1 = "" Then $Value1 = $GET_ARRAY[$1] EndIf Next GUICtrlSetData($COMBO_ID, "") If StringRight($Value,1) = "|" Then $Value = StringTrimRight($Value,1) GUICtrlSetData($COMBO_ID, $Value,$Value1) EndFunc Func _Read_Section_Names($INI_FILE) Local $RETUR_VALUE[1],$1,$2 = 0,$3 = 0,$4 = 0 Local $READ_VALUE1,$READ_VALUE2,$READ_VALUE3,$1,$2 = 0 $READ_VALUE1 = IniReadSectionNames($INI_FILE) If Not @error Then For $1 = 1 To $READ_VALUE1[0] If $2 > 0 Then ReDim $RETUR_VALUE[$2 + 1] $RETUR_VALUE[$2] = $READ_VALUE1[$1] $2 += 1 Next EndIf If $RETUR_VALUE[$2-1] = "" Then ReDim $RETUR_VALUE[$2 -1] _ArraySort($RETUR_VALUE) ;~ _ArrayDisplay($RETUR_VALUE) Return $RETUR_VALUE EndFunc[/CODE] Sonra comboboxu section isimlerine göre güncellemek için; [CODE]_Update_ComboBox($hCombo,_Read_Section_Names($dosya))[/CODE] Satırını uygun yere yaz. Tabi ilgili combo için diğer GUICtrlSetData satırlarını sil. Neyse kolay gelsin... Link to comment Share on other sites More sharing options...
mustafakara Posted April 26, 2010 Author Share Posted April 26, 2010 arkadaşlar autoitte list box lardaki metinlerin son 4 harfini nasıl görünmez yaparızdosyaları listelerken uzantılarının görünmesini istemiyorum örneğin: "ankara.lst" dosyasının sadece "ankara" olarak görmek istiyorum bunun için nasıl birşey yapmak gerekir teşekkürler Link to comment Share on other sites More sharing options...
blackman12 Posted April 27, 2010 Share Posted April 27, 2010 stringtrimright komutunu kullanın Link to comment Share on other sites More sharing options...
mustafakara Posted April 27, 2010 Author Share Posted April 27, 2010 blackman12 ye teşekkür denedim ancak scripte nasıl ekleyeceğimi anlayamadım sevgili arkadaşlar: code: stringtrimright("",4) bu kodu listbox üzerinde nasıl kullanabilirim dosyaların uzantılarını gizlemek amaçlı teşekkürler Link to comment Share on other sites More sharing options...
blue_life Posted April 27, 2010 Share Posted April 27, 2010 @mustafakara Mantığını kavraman için ufak bir örnek; Global $BL_Test[5][2] $Form1 = GUICreate("Form1", 177, 214, 733, 381) $Combo1 = GUICtrlCreateCombo("", 16, 16, 145, 25) $List1 = GUICtrlCreateList("", 16, 48, 145, 97) GUISetState(@SW_SHOW) _BL_Test() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case -3 Exit Case $Combo1 $Value = GUICtrlRead($Combo1) For $I = 0 To UBound($BL_Test) -1 If $BL_Test[$I][1] = $Value Then MsgBox(64,"",$BL_Test[$I][0]) ExitLoop EndIf Next Case $List1 $Value = GUICtrlRead($List1) For $I = 0 To UBound($BL_Test) -1 If $BL_Test[$I][1] = $Value Then MsgBox(64,"",$BL_Test[$I][0]) ExitLoop EndIf Next EndSwitch WEnd Func _BL_Test() Local $ComboValue,$ComboDefValue $BL_Test[0][0] = "Test1.exe" $BL_Test[1][0] = "Test2.ini88" $BL_Test[2][0] = "Test3.inf55" $BL_Test[3][0] = "Test4.oem44" $BL_Test[4][0] = "Test5.BlueLife" For $I = 0 To UBound($BL_Test) -1 If StringInStr($BL_Test[$I][0],".") Then $BL_Test[$I][1] = StringLeft($BL_Test[$I][0],StringInStr($BL_Test[$I][0],".",0,-1) -1) Else $BL_Test[$I][1] = $BL_Test[$I][0] EndIf $ComboValue &= $BL_Test[$I][1] & "|" If $ComboDefValue = "" Then $ComboDefValue = $BL_Test[$I][1] Next GUICtrlSetData($Combo1,$ComboValue,$ComboDefValue) GUICtrlSetData($List1,$ComboValue) EndFunc[/CODE] Link to comment Share on other sites More sharing options...
mustafakara Posted April 28, 2010 Author Share Posted April 28, 2010 sevgili BlueLife sana çok teşekkür ederim sen detaylı olarak anlamam amaçlı anlatmaya çalışmışsın ama malesef karmaşık geldi aşağıdaki örnek üzerinde anlatabilirseniz sevinirim buradaki dosya uzantılarını göstermesin code: #include <GUIListBox.au3> #include <GuiConstantsEx.au3> #include <Constants.au3> Opt('MustDeclareVars', 1) $Debug_LB = False _Main() Func _Main() Local $hListBox,$ak GUICreate("List Box Dir", 400, 296) $hListBox = GUICtrlCreateList("", 2, 2, 396, 296) GUISetState() _GUICtrlListBox_Dir($hListBox, @WindowsDir & "\*.exe" ) ; Loop until user exits Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>_Main Link to comment Share on other sites More sharing options...
blue_life Posted April 28, 2010 Share Posted April 28, 2010 @mustafakara Kolay gelsin... _Main() Func _Main() Local $hListBox,$ak GUICreate("List Box Dir", 400, 296) $hListBox = GUICtrlCreateList("", 2, 2, 396, 296) Global $FileList = _BL_ListBoxDir($hListBox,@WindowsDir,"*",".exe") GUISetState() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case -3 Exit Case $hListBox $Value = GUICtrlRead($hListBox) If UBound($FileList) Then For $I = 0 To UBound($FileList) -1 If $Value = $FileList[$I][1] Then MsgBox(64,"",$FileList[$I][0]) ExitLoop EndIf Next EndIf EndSwitch WEnd GUIDelete() EndFunc;==>_Main Func _BL_ListBoxDir($Hwnd,$Path,$Filename,$FileEx) If StringRight($Path,1) <> "\" Then $Path &= "\" If not FileExists($Path) Then Return SetError(1) Local $search = FileFindFirstFile($Path & $Filename & $FileEx),$Value1,$Value2,$1 = 0 If $search = -1 Then Return SetError(1) Local $TotalFile[1][2] While 1 $Value1 = FileFindNextFile($search) If @error Then ExitLoop If $1 > 0 Then ReDim $TotalFile[$1 + 1][2] $TotalFile[$1][0] = $Value1 $TotalFile[$1][1] = StringLeft($TotalFile[$1][0],StringInStr($TotalFile[$1][0],$FileEx,0,-1) -1) $Value2 &= $TotalFile[$1][1] & "|" $1 += 1 WEnd FileClose($search) GUICtrlSetData($Hwnd,$Value2) Return $TotalFile EndFunc[/CODE] Link to comment Share on other sites More sharing options...
mustafakara Posted April 28, 2010 Author Share Posted April 28, 2010 blue_life arkadaşım çokteşekkür ederim ellerin dert görmesin Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.