[Frage]VB08 listbox

05/12/2010 07:25 'Haseo#1
Hi,
wollte fragen, wie man das aktuell angewählte Item umändert sprich:
Listbox1.items = Metin2, WoW, 4 Story
jetzt will ich WoW in Runescape verändern ohne das es die 2te Position verlässt!
Wie mache ich das??
MfG
Bestshocker
05/12/2010 16:17 x]vIrus[x#2
ohne jetzt wirklich vb zu können, schätz ich ma, dass das so geht:
Listbox1.Items(2) = "Runescape";
05/12/2010 16:28 Demon-777#3
So weit ich es verstanden habe geht es so :

Code:
Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim item1 As Integer = ListBox1.Items.Add("Metin2")
        Dim item2 As Integer = ListBox1.Items.Add("Nostale")
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim currentItem As Object = ListBox1.SelectedItem()
        Dim index As Integer = ListBox1.Items.IndexOf(currentItem)
        Dim text As String = TextBox1.Text

        ListBox1.Items.Item(index) = text
    End Sub

End Class
05/15/2010 08:36 Chain Reaction#4
= Me.ListBox1.SelectedItem
bin mir nicht sicher ;)