I have a peice of code i want to be ran constantly... how can i make it do that?
If i cant, how would i go about doing this:
I have a label, and i want to make that lable change when people put a letter in it. For example, when they put the letter X in box A the lable down the bottom changes colour and says "Letters are NOT allowed". I have about 10 text boxes on the screen. Currently, i have it on text change, but that screws up if i alernate between two boxes with letters in it and not in it....
The code im using currently to decide it is:
CODE
If Not IsNumeric(dram.Text) Then If dram.Text <> "" Then err.Text = "Letters are NOT allowed" Else err.Text = "Everything fine"
If Not IsNumeric(dram.Text) Then If dram.Text <> "" Then err.ForeColor = Color.Red Else err.ForeColor = Color.RoyalBlue
And normally, i would state the above as
CODE
If Not IsNumeric(dram.Text) Then If dram.Text <> "" Then err.Text = "Letters are NOT allowed" Else err.Text = "Everything fine" and err.ForeColor = Color.Red Else err.ForeColor = Color.RoyalBlue
But it wont allow me...
This is the second VB programs im trying to make

I dont fully know the program as of yet.
As well, how would i go about making it also decide on whats the highest whole number that is possible by timings x by a whole number.
I tried this, but i know it does work although im sure theres a far better way of doing it
CODE
Dim valid As Integer
valid = 0
If bussR.Text * 4 <= dram.Text Then valid = 4 Else If bussR.Text * 3 <= dram.Text Then valid = 3 Else If bussR.Text * 2 <= dram.Text Then valid = 2 Else If bussR.Text * 0.5 <= dram.Text Then valid = 1
If valid = 1 Then dramR.Text = bussR.Text * 0.5
If valid = 2 Then dramR.Text = bussR.Text * 2
If valid = 3 Then dramR.Text = bussR.Text * 3
If valid = 4 Then dramR.Text = bussR.Text * 4
Thats an example of what i want it to do (just be timsable by 0.5, 2, 3, 4)
I have attatched the project. This is Visual Basic 2008 express.
This post has been edited by mattisdada: 30 May, 2008 - 10:40 PM