kapucu1971 Posted July 4, 2012 Share Posted July 4, 2012 (edited) listboxun on double-click evresi bu şekilde tSecilen = ListBox.GetSelected(this) if tSecilen then sData = ListBox.GetItemData("Programlar", tSecilen[1]) result = File.Run("programlar" ...... end listboxda seçili program exe sini çalıştırmak istiyorum veri listboxa geliyor tıkladığımda exe çalışmıyor kodumda eksik olan yeri tamamlayabilirmisiniz Edited July 4, 2012 by kapucu1971 Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted July 4, 2012 Editor Share Posted July 4, 2012 File.Run(exeismi); bu şekilde çalıştırabilirsiniz. Quote Link to comment Share on other sites More sharing options...
kapucu1971 Posted July 4, 2012 Author Share Posted July 4, 2012 ama listboxda bir fazla exe var hangi listboxda File.Run(exeismi); şeklinde yazarsam hepsi için ayrı ayrı yol göstermem gerekir diye düşünüyorum bunun daha kısa yolu yokmudur. Quote Link to comment Share on other sites More sharing options...
KintaRo Posted July 4, 2012 Share Posted July 4, 2012 Page On Show kodları: [code]ListBox.DeleteItem("ListBox1", -1) -- listboxı sıfırla -- docs klasorundeki exe leri listele, dosya yollarını ListBox ItemData'ya depola, dosya isimlerini ListBox'a yazdır tDosyalar = File.Find("AutoPlay\\Docs", "*.exe", false, false, nil, nil) -- exe dosyalarını bul if tDosyalar then -- eğer klasör boş değilse for i,v in pairs(tDosyalar) do sDosyaIsmi = String.SplitPath(v).Filename sDosyaYolu = v ListBox.AddItem("ListBox1", sDosyaIsmi, sDosyaYolu) end end[/code] ListBox On DoubleClick kodları: [code]tSecilen = ListBox.GetSelected("ListBox1") if tSecilen ~= nil then sDosyaYolu = ListBox.GetItemData("ListBox1", tSecilen[1]) File.Run(sDosyaYolu, "", "AutoPlay\\Docs", SW_SHOWNORMAL, false) end[/code] Quote Link to comment Share on other sites More sharing options...
WolfmanTR_ Posted November 11, 2012 Share Posted November 11, 2012 [quote name='KintaRo' timestamp='1341392995' post='1218478'] Page On Show kodları: [code]ListBox.DeleteItem("ListBox1", -1) -- listboxı sıfırla -- docs klasorundeki exe leri listele, dosya yollarını ListBox ItemData'ya depola, dosya isimlerini ListBox'a yazdır tDosyalar = File.Find("AutoPlay\\Docs", "*.exe", false, false, nil, nil) -- exe dosyalarını bul if tDosyalar then -- eğer klasör boş değilse for i,v in pairs(tDosyalar) do sDosyaIsmi = String.SplitPath(v).Filename sDosyaYolu = v ListBox.AddItem("ListBox1", sDosyaIsmi, sDosyaYolu) end end[/code] ListBox On DoubleClick kodları: [code]tSecilen = ListBox.GetSelected("ListBox1") if tSecilen ~= nil then sDosyaYolu = ListBox.GetItemData("ListBox1", tSecilen[1]) File.Run(sDosyaYolu, "", "AutoPlay\\Docs", SW_SHOWNORMAL, false) end[/code] [/quote] peki, Treelist e göre nasıl uyarlarız ? Quote Link to comment Share on other sites More sharing options...
KintaRo Posted November 11, 2012 Share Posted November 11, 2012 Page On Show: [CODE] TreeList.AddColumn("Plugin1", "program adı", 200) TreeList.ClearRows("Plugin1") -- docs klasorundeki exe leri listele, dosya yollarını ListBox ItemData'ya depola, dosya isimlerini ListBox'a yazdır tDosyalar = File.Find("AutoPlay\\Docs", "*.exe", false, false, nil, nil) -- exe dosyalarını bul if tDosyalar then -- eğer klasör boş değilse for i,v in pairs(tDosyalar) do sDosyaIsmi = String.SplitPath(v).Filename TreeList.AddRow("Plugin1", sDosyaIsmi, nil, 0, nil) end end [/CODE] Treelist OnDoubleClick [CODE]nSecilen = TreeList.GetSelected("Plugin1") if nSecilen ~= -1 then sDosyaYolu = _SourceFolder .. "\\Autoplay\\Docs\\" .. TreeList.GetCellText("Plugin1", nSecilen, 0) File.Run(sDosyaYolu, "", "AutoPlay\\Docs", SW_SHOWNORMAL, false) end [/CODE] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.