I'm just starting to learn VB6 with no other coding expierience and I need some help. I know this simple calcualtor I'm trying to make has been made and can be found on 100,000 websites but I wanted to see if Ic an make it.
Basically I have 3 labels (Kilobytes, Megabytes, Gigabytes), 3 text boxes (Named KB, MB, and GB) , and a command button. this is what the code looks like:
Private Sub Command1_Click()
If KB.Text = Int(KB.Text) Then (GB.Text = Val(KB.Text / 1048576) and (MB.Text = Val(KB.Text / 1024)
End If
If MB.Text = Int(MB.Text)
Then (KB.Text = Val(MB.Text * 1024) and (GB.Text = Val(MB.Text / 1024)
End If
If GB.Text = Int(GB.Text)
Then (MB.Text = Val(GB.Text * 1024) and (KB.Text = Val(GB.Text * 1048576)
End If
End Sub
I've tried 30 tutorials and I'm loosing patience what am I doing wrong? It won't work. I'm guessing it's something really stupid. oh and BTW how do you use the Cbyte(expression) command?