thank you for helping me out...again^^
As you can maybe see, i want to give the user the possibility to switch the language.
My problem is, that the dropdown always selects DE
, even if i click on EN
. And iI have absolutely no clue, why this happens. And sorry, that I cant post the whole code, but it would be 300 lines of Windows Forms Code xD
#ChangeEvent DropDownMenu
$combobox1_SelectedIndexChanged=
{
if($combobox1.Text = "DE")
{
$Label1.Text = "Willkommen zur TimeStamp Installation"
$Label2.Text = ("Um fortzufahren bitte " + '"' + "Weiter" + '"' + " drücken")
$Label3.Text = ("Zum Abbrechen " + '"' + "Abbrechen" + '"' + " drücken")
$Label4.Text = "Sprache"
$Label5.Text = "Wähle dein Programm"
$groupBox1.Text = 'Programme'
$radioButton1.Text = 'TimesStamp'
$radioButton2.Text = 'TimeStamp mit Berichtsheft'
$Label6.Text = "Installationspfad"
$Label7.Text = "Wähle den gewünschten Installationspfad"
$windowButton1.Text = "Durchsuchen..."
$Label8.Text = "Ein paar Extras"
$Label9.Text = "Fast fertig."
$checkbox1.Text = "Erstelle eine Verknüpfung auf dem Desktop"
$windowButton2.Text = "Weiter"
$windowButton3.Text = "Weiter"
$windowButton4.Text = "Weiter"
$windowButton6.Text = "Fertig"
$windowButton5.Text = "Abbrechen"
}
else
{
$Label1.Text = "Welcome to the TimeStamp Installation Setup"
$Label2.Text = ("To Continue the Installation please press " + '"' + "Continue" + '"')
$Label3.Text = ("Else press " + '"' + "Exit" + '"' + " to cancel the installation")
$Label4.Text = "Language"
$Label5.Text = "Choose your Program"
$groupBox1.Text = 'Programs'
$radioButton1.Text = 'TimesStamp'
$radioButton2.Text = 'TimeStamp with Report booklet'
$Label6.Text = "Setup Install Location"
$Label7.Text = "Choose the Folder where the Installation should take place"
$windowButton1.Text = "Browse..."
$Label8.Text = "Some Extras"
$Label9.Text = "Almost finished."
$checkbox1.Text = "Create Shortcut on Desktop"
$windowButton2.Text = "Continue"
$windowButton3.Text = "Continue"
$windowButton4.Text = "Continue"
$windowButton6.Text = "Finish"
$windowButton5.Text = "Exit"
}
$window.Refresh()
$combobox1.Refresh()
}
#Actual DropDownMenu
$combobox1 = New-Object System.Windows.Forms.Combobox
$combobox1.Location = New-Object System.Drawing.Point(470,30)
$combobox1.Size = New-Object System.Drawing.Size(50,20)
$combobox1.Height = 80
$combobox1.Items.Add("EN")
$combobox1.Items.Add("DE")
#Activate Event
$combobox1.add_SelectedIndexChanged($combobox1_SelectedIndexChanged)