Greetings,
I'm a bit new at Visual Basic 2010, and i have one main problem. I want to creat a Calculator for a game, however i have issues getting it to work.
When i select a setting from my main Combobox i want it to add different settings for the other comboboxes, example:
I pick from my main Combobox - "Wizard"
On one of my other comboboxes i want these two settings to be pickable -
"Main-Hand + Source" and "Main-Hand + Shield"
Now if i instead of Wizard select "Barbarian"
i want my other combobox to remove the "Main-Hand + Source" and "Main-Hand + Shield" and instead add
"Main-Hand + Off-Hand" and "Main-Hand + Shield"
This should be automatically done using a timer. Here is my code so far:
Public Class Form1
Private Sub EnableTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles EnableTimer.Tick
If ClassCombo.Text = "Wizard" Then
WizardTimer.Enabled = True
Else : WizardTimer.Enabled = False
End If
If ClassCombo.Text = "Barbarian" Then
BarbTimer.Enabled = True
Else : BarbTimer.Enabled = False
End If
End Sub
Private Sub WizardTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles WizardTimer.Tick
BuildCombo.Items.Add("Main-Hand + Source")
BuildCombo.Items.Add("Main-Hand + Shield")
MainCombo.Items.Add("Spear")
MainCombo.Items.Add("Sword")
MainCombo.Items.Add("Wand")
MainCombo.Items.Add("Mace")
MainCombo.Items.Add("Axe")
WizardTimer.Stop()
End Sub
Private Sub BarbTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BarbTimer.Tick
BuildCombo.Items.Add("Main-Hand + Shield")
BuildCombo.Items.Add("Main-Hand + Off-Hand")
MainCombo.Items.Add("Spear")
MainCombo.Items.Add("Sword")
MainCombo.Items.Add("Mighty Weapon")
MainCombo.Items.Add("Mace")
MainCombo.Items.Add("Axe")
BarbTimer.Stop()
End Sub
End Class
But if i do this, my comboboxes are just mass spammed with Spear, Spear, Spear, Spear, Sword, Sword, Sword, etc, etc, etc and so are my main-hand + off-hand etc.
Anyway to make this only add the items 1 time, then stop and if i switch it will remove those items and add the new 1 time?