ana sayfa > Görsel Programlama, VB.NET > İsim Ekle Sil VB.Net

İsim Ekle Sil VB.Net

Perşembe, 19 Mar 2009 yorum ekle yorumlara git




Formumuza 1 listbox, 1 textbox ve 5 button ekliyoruz formumuzun genel görünümü aşağıda ki gibi olacaktır.

adsiz1

 

 

 

button 1, button2, button 3, button4, button 5 bu butonlara aşağıdaki kodları yazıyoruz.

 

*Form 1 kısmına aşagıdaki kodu yazıyoruz

  



ListBox1.Items.Remove(ListBox1.Text)

 

*Button 1 kısmına aşağıdaki kodu yazıyoruz

 

ListBox1.Items.Remove(ListBox1.Text)

 *Button 2 kısmına aşagıdaki kodları yazıyoruz

 

ListBox1.Items.Add(TextBox1.Text)

  *Button 3 kısmına aşağıdaki kodları yazıyoruz

 

Label2.Text = ListBox1.Items.Count.ToString()

*Button 4 kısmına aşağıdaki kodları yazıyoruz

 [code'VB.Net']Dim i, j As Integer
        For i = 0 To ListBox1.Items.Count - 1
            For j = 0 To ListBox1.Items.Count - 1
                If Val(ListBox1.Items.Item(j)) > Val(ListBox1.Items(i)) Then
                    k = ListBox1.Items.Item(i)
                    ListBox1.Items.Item(i) = ListBox1.Items.Item(j)
                    ListBox1.Items.Item(j) = k

                End If
            Next
        Next
[/code]

*Button 5 kısmına aşağıdaki kodları yazıyoruz

 

        Dim a As Integer
        For a = 1 To 20
            Randomize()
            ListBox1.Items.Add(Int(Rnd() * 100))
        Next

 

Projeyi İndir: İsim Ekle Sil VB.Net





  1. şimdilik yorum yok.
  1. şimdilik geri bağlantı yok