Hey all,
I have just recently (couple of days) begun to learn VB.Net. I do not have any other programming experience other than some novice php coding, however, I have been "studying" through books and the internet. I am making pretty good progress with my understanding considering the time frame, but I think I am just totally missing something as it seems I keep running into the same problems over and over and I believe I am simply making a simple mistake but I cannot figure it out.
Basically I am trying to make a calculator that will calculate Ebay fees. I am getting lots of bugs that I am doing a fair job of working out, but I think I am very confused with why/when/how to convert variables as that seems to be my most encountered problem.
For instance, I want to read the value from a textbox, evaluate the value and then perform a simple mathematical computation based upon the evaluation, then print the computation in a label field. Here is the code I have tried (don't laugh too hard):
Private Sub EbayFees()
If Val(TextBox2.Text <= 25) Then
Label4.Text = Val(TextBox2.Text * 0.0525)
End If
End Sub
Obviously there would be more similar evaluations to follow if I can ever get the first one to work. When I try this, I get the following error:
An unhandled exception of type 'System.NullReferenceException' occurred in microsoft.visualbasic.dll
Additional information: Object reference not set to an instance of an object.
I know that this is probably very simple, however, it's not simple for me. If someone can point out what I am doing wrong I would appreciate it. Like I said, I think (actually I know) that I am not grasping the whole variable thing entirely.
Thanks in advance