Button Variable VB.Net
im creating a game the uses Skills such as heal, strike etc. i want they
player to be able to assign the skill to a hotkey. but im looking for a
way where i can make a "Variable" button, that can do things like this:
change a variable like "Name"'s value to an already created button name
value. EX:
Dim bla As New Button
Private Sub btnHot3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnHot3.Click
bla = New Button
bla.Name = "btnHot3"
Hotkey(SkillUsed, bla)
End Sub
Sub Hotkey(ByVal skillused As Integer, ByVal bla As Button)
If SkillSelected = 1 Then
btnHot3.Image = My.Resources.Heal
ElseIf SkillSelected = 2 Then
bla.Image = My.Resources.Strike
ElseIf SkillSelected = 3 Then
bla.Image = My.Resources.Finisher
End If
End Sub
No comments:
Post a Comment