I'm developing a forum-based game and am trying to write up a simple program to help determine income bonuses. I've tried my hand at VB a number of times, but usually get frustrated and never try to take it seriously. Now I'm looking for some help, after no luck of searching the internet/help files.
My form has a NumericUpDown element, that goes up to 10 (I would like it so that only numbers 1-10 are available, and the user cannot go down to 0, but I don't know how to do that). This NumericUpDown element selects the "Acumen score", which is supposed to translate into the variable "a".
Variable "a" then undergoes a simple algorithm to produce the variable "b", which then appears in the element Label2. The problem I am running into here, is not being able to "refresh" the Label2 element. I've tried adding a Button1 element, and assigning onclick "Label2.Refresh()", but that doesn't seem to be correct as nothing happens.
Here's my code: (numAcumen is the name of the NumericUpDown element)
Code:
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim A As Double = numAcumen.Value
Dim B As Double = A * 1.5 / 3
Label2.Text = B
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Label2.Refresh()
End Sub
Private Sub numAcumen_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles numAcumen.ValueChanged
End Sub
Private Sub Button1_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.GotFocus
End Sub
End Class
I have attached a screenshot of the form, if that helps any.
The goal of this simple program is for the user to select the "Acumen score" in the NumericUpDown element, have the algorithm run using the selected number, and then hit the button to display the result of the algorithm in the Label2 element.
I'm sure I'm missing a very small and simple step, but I'm a noob at VB and have tried looking a lot of places but with no luck.