Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

VB 08 ListBox Tutorial

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
3,943
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on May 18, 2009

http://codingshare.de/
http://zerofix.de/
Watch in HD & FullScreen !
Den Code gleich auch noch :)

Code :


Public Class Form1 Dim Reader As System.IO.StreamReader Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Try Reader = System.IO.File.OpenText("C:\Beispiel.txt") 'IO.File.OpenText("Dein Verzeichniss") = IO.Datei.ÖffneText("Dein Verzeichniss") ListBox1.Items.Add(Reader.ReadLine) 'oder : ListBox1.Items.Add(Reader.ReadToEnd) ' Wenn Reader.ReadLine verwendet wird und dann Reader.ReadToEnd dann wird nur der Rest der Datei gelesen Catch ex As Exception MsgBox("Datei kann nicht gelesen werden !", MsgBoxStyle.Critical, "Datei nicht gefunden !") End Try End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If RadioButton1.Checked = True Then Dim Open As New OpenFileDialog Open.Filter = "Textdateien [*.txt] | *.txt" Open.Title = "Öffnen und Hinzufügen" Try Dim StringReader As System.IO.StreamReader Open.ShowDialog() StringReader = System.IO.File.OpenText(Open.FileName) ListBox1.Items.Add(StringReader.ReadLine) Catch ex As Exception MsgBox("Kein Objekt ausgewählt.", MsgBoxStyle.Exclamation, Nothing) End Try Else Dim Open As New OpenFileDialog Open.Filter = "Textdateien [*.txt] | *.txt" Open.Title = "Öffnen und Hinzufügen" Try Dim StringReader As System.IO.StreamReader Open.ShowDialog() StringReader = System.IO.File.OpenText(Open.FileName) ListBox1.Items.Add(StringReader.ReadToEnd) Catch ex As Exception MsgBox("Kein Objekt ausgewählt.", MsgBoxStyle.Exclamation, Nothing) End Try End If End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click ListBox1.Items.Remove(ListBox1.SelectedItem) End Sub
End Class

THX for watching !

Category:

Education

Tags:

License:

Standard YouTube License

Link to this comment:

Share to:

Uploader Comments (Player1070)

  • in meinem nächstem video schaut ihr wie ein chat geht :D

  • Mal 'n paar Tipps:

    -Zeigen was des überhaupt macht

    -Gute Musik

    -Anfang mal begrüßen

    Bitte nimm dir's zu Herzen =)

  • thanxs (=

    werd ich beim nächstem machen ^^

see all

All Comments (4)

Sign In or Sign Up now to post a comment!
  • WTF? German? Although the codes worked thx dude! 5/5 u should include german in the cideo name

  • dude maybe instead of wasting non german ppl's time call the video VB 08 ListBox Tutorial(GER)

    -.-

  • cool =P

    click mal mein neues video an

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more