Jump to content

Listbox Verilerini Sıralamak


bitmez13
 Share

Recommended Posts

listboxa veriyi alıyorum aynı zamanda yeni verileride ekliyorum ama eklenenler hep alt alta oluyor.ben istiyorumki listboxdaki veriler a-z ye otomatik sıralansın bunun için nasıl bir kod yazmalıyım

ali
veli
selami
fevzi

şeklindeki listbox verileri otomatik olarak

ali
fevzi
selami
veli şeklinde sıralnamasını istiyorum kodda yardımcı olurmusunuz.
Link to comment
Share on other sites

verileri sıralamanın en kolay yolu Table.Sort() 'dur. Tabi bunun için veriler bir tabloda depolanmalıdır. Örneğin isimleri alıp sıraladıktan sonra ListBox nesnesine yazdıralım:

[code]tIsimler = {"ali", "veli", "selami", "cemil"}
Table.Sort(tIsimler, nil)

for i,v in pairs (tIsimler) do
ListBox.AddItem("ListBox1", v, "")
end[/code]

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...