Yazılım.
CevapSitesi.com Beta!
Çözüm Noktası
Bu siteyi Facebook, Twitter, Google+ veya e-posta ile paylaşın.
| Sorular | Makaleler | Üyeler | Etiketler  | İletişim
Soru sormak ya da cevap vermek için;
giriş yapın veya üye olun.

Sosyal medya hesaplarınızla da giriş yapabilirsiniz.

0



ASP.NET Listbox Seçim

  1. Dim i As Integer
  2. i = ListBox1.SelectedIndex
  3. With ListBox1.Items
  4. If i < ListBox1.Items.Count - 1 Or TextBox3.Text > listboxcount - 1 Then
  5. TextBox3.Text = TextBox3.Text + 1
  6. ListBox1.SelectedIndex = TextBox3.Text
  7. Label1.Text = ListBox1.SelectedItem.Text
  8. Label1.Text = Label1.Text.Substring(0, Label1.Text.Length - 5)
  9. End If
  10. End With

button içindeki böyle bir kodla litsbox daki itemleri secerek başka bir yere aktarıyorum ama textbox3deki sayı litbox item sayılarından büyük olunca hata veriyor sizce cözüm ne olmalı "with " yapısı işe yara gibi ama çözüm bulamadım.

1 Cevap


0


  1. ... TextBox3.Text > listboxcount - 1 Then ...
ifadesindeki karşılaştırma operatörü > değil < olacak.

i değişkeni gereksiz.

With bu kodda hiç bir işe yaramaz.

Şöyle bir şey dene.
  1. If ListBox1.SelectedIndex > -1 And Val(TextBox3.Text) < ListBox1.Items.Count - 1 Then
  2. TextBox3.Text = TextBox3.Text + 1
  3. ListBox1.SelectedIndex = TextBox3.Text
  4. Label1.Text = ListBox1.SelectedItem.Text
  5. Label1.Text = Label1.Text.Substring(0, Label1.Text.Length - 5)
  6. End If
  7.  


Cevaplayan: 27.07.19 12:59
cevapsitesi
102,040p 16ü

Bir cevap yazın: