CRX4LIFE18
asked on
Adding Hex Values in Visual Basic
Hello,
I'm looking to add some Hex values in Visual Basic 2005, for example:
0x40+0x08+0x04+0x02 = 0x4E
I need to have 0x4E as a string in the end so I can include it in a label.
But I have not been able to figure out how to do this. I'm sure it's something simple, but I'm lost... Any help would be appreciated, much thanks...
-Matt
I'm looking to add some Hex values in Visual Basic 2005, for example:
0x40+0x08+0x04+0x02 = 0x4E
I need to have 0x4E as a string in the end so I can include it in a label.
But I have not been able to figure out how to do this. I'm sure it's something simple, but I'm lost... Any help would be appreciated, much thanks...
-Matt
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Perfect, thank you very much!!!
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim HexArray() As String = {"0x40", "0x08", "0x04", "0x02"}
Dim IntResult As Integer
For i As Integer = 0 To HexArray.GetUpperBound(0)
IntResult += Integer.Parse(HexArray(i).
Next
MsgBox(String.Format("Resu
End Sub
End Class