2. if ile 2. else de çalııyor neden olabilir? if uyarı veriyor ama ardından else'de yazdıklarımda gerçekleşiyor
If TextBox1.Text = "" Then MsgBox("İtem kodu girmediniz!", vbExclamation, "Dikkat") Else For i As Int32 = 0 To ListBox1.Items.Count - 1 If ListBox1.Items(i) = TextBox1.Text Then MsgBox("aranan bulundu") ListBox1.SelectedIndex = i Else ListBox1.Items.Add(TextBox1.Text) ListBox2.Items.Add(TextBox1.Text) TextBox1.Clear() Exit For End If Next end if
Çözüldü. End if'i Exit for'dan önce yazmam gerekiyormuş