I'm not 100% sure this is what you need, but the code below will convert a decimal integer value into binary. It assumes the decimal value is being entered in TextBox1, the result is put into TextBox2, executed from the click event of Button1.
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
Dim Dec_Value As Long = CLng(TextBox1.Text)
Dim Bin_Value As String = ""
Dim Temp As Long
Temp = 1
Do Until Temp > Dec_Value
Temp = Temp * 2
Loop
Do Until Temp < 1
If Dec_Value >= Temp Then
Bin_Value &= "1"
Dec_Value -= Temp
ElseIf Bin_Value <> "" Then
Bin_Value &= "0"
End If
Temp = Temp / 2
Loop
TextBox2.Text = Bin_Value
Catch
MsgBox("Invalid input value entered")
End Try
End Sub