hey-
I just started using VB.NET and I'm trying to write a program for a Computer Architecture class that converts a binary number into a decimal the other way around. I've got the form set up like I want it...just two text boxes, labels, and a convert button. I'm having trouble with the logic on the button though, as well as the formula. Here's what I have so far:
I'm getting errors on the if statements about using a string as a boolean value. All I want to do is have it perform the conversion if there's text in the box. I'm not looking to make a production quality program...this is just a homework assignment for the arch class...not my VB. Any help would be appreciated, thanks.
I just started using VB.NET and I'm trying to write a program for a Computer Architecture class that converts a binary number into a decimal the other way around. I've got the form set up like I want it...just two text boxes, labels, and a convert button. I'm having trouble with the logic on the button though, as well as the formula. Here's what I have so far:
Private Sub btnConvert_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnConvert.Click
txtBin.Text = " "
txtDec.Text = " "
If (txtBin.Text) Then
txtDec.Text = (conversion formula)
ElseIf (txtDec.Text) Then
txtBin.Text = (conversion formula)
End If
End Sub
Private Sub txtBin_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtBin.TextChanged
End Sub
End Class
I'm getting errors on the if statements about using a string as a boolean value. All I want to do is have it perform the conversion if there's text in the box. I'm not looking to make a production quality program...this is just a homework assignment for the arch class...not my VB. Any help would be appreciated, thanks.