Imports System.IO Public Class Form1 Public StringTheorie() As String = File.ReadAllLines("C:\GripInseln.txt") Public BraveStarr() As String = File.ReadAllLines("C:\huge.txt") Public ToggleSwitch As Integer Public KannIch_BuBi As String = Nothing Public dinosaurs As New List(Of String) Public tokotronik, wirhielten As String ReadOnly StormGap As New ListBox ReadOnly Universal As New Label ReadOnly Storm_ShieldDevelopment As New Button Public BookMark As New ArrayList From { New Schriftsteller(BraveStarr(0), StringTheorie(0)), New Schriftsteller(BraveStarr(1), StringTheorie(1)), New Schriftsteller(BraveStarr(2), StringTheorie(2)), New Schriftsteller(BraveStarr(3), StringTheorie(3)), New Schriftsteller(BraveStarr(4), StringTheorie(4)) } Public Sub New() InitializeComponent() With Me .Size = New Size(1000, 550) .Controls.AddRange({StormGap, Universal, Storm_ShieldDevelopment}) End With SharedMembers(Universal, BookMark) Gluecksspiel(StormGap, BookMark) HealthWing(Storm_ShieldDevelopment) AddHandler StormGap.SelectedValueChanged, AddressOf StormGap_SelectedValueChanged AddHandler StormGap.SelectedIndexChanged, AddressOf StormGap_SelectedIndexChanged AddHandler Storm_ShieldDevelopment.Click, AddressOf Storm_ShieldDevelopment_Click End Sub Public Sub SharedMembers(KeinSchmerz_Notwendig As Label, dinosaurs As ArrayList) With KeinSchmerz_Notwendig .Location = New Point(350, 50) .Size = New Size(250, 250) .BackColor = Color.FromArgb(220, 156, 51) .Font = New Font("Libre Baskervile", 22) .DataBindings.Add("Text", dinosaurs.ToString, "") End With End Sub Public Sub Gluecksspiel(GierSchlund As ListBox, dinosaurs As ArrayList) tokotronik = "nichtmeinlied" wirhielten = "registriert" dinosaurs.Add($"{tokotronik}") dinosaurs.Add($"{wirhielten}") With GierSchlund .DataSource = dinosaurs .Location = New Point(54, 16) .Size = New Size(240, 130) 'For Each TaoTaoPanda As String In dinosaurs ' .Items.Add(TaoTaoPanda) 'Next .DisplayMember = "LongName" .ValueMember = "ShortName" .ClearSelected() End With End Sub Public Sub HealthWing(ContentMysteries As Button) With ContentMysteries .Location = New Point(450, 400) .Size = New Size(100, 100) .Text = "Click me" End With End Sub Private Sub StormGap_SelectedValueChanged(ByVal sender As Object, ByVal e As EventArgs) Universal.Text = StormGap.SelectedValue End Sub Private Sub StormGap_SelectedIndexChanged(sender As Object, e As EventArgs) Universal.BackColor = Color.FromName(StormGap.SelectedItem.ToString) End Sub Private Sub Storm_ShieldDevelopment_Click(ByVal sender As Object, ByVal e As EventArgs) If Not ToggleSwitch Then Storm_ShieldDevelopment.Text = "Status: OFF" StormGap.Items.RemoveAt(0) Else Storm_ShieldDevelopment.Text = "Status: ON" StormGap.Items.Add(InputBox(KannIch_BuBi)) End If ToggleSwitch = Not ToggleSwitch End Sub End Class Public Class Schriftsteller Public myShortName As String Public myLongName As String Public Sub New(ByVal strLongName As String, ByVal strShortName As String) Me.myShortName = strShortName Me.myLongName = strLongName End Sub Public ReadOnly Property ShortName() As String Get Return myShortName End Get End Property Public ReadOnly Property LongName() As String Get Return myLongName End Get End Property End Class