HomeVb.Net

VB.NET Convert From Binary, Decimal, and Hexadecimal

VB.NET tutorials : How to convert Binary to Decimal, Binary to Hexadecimal and Decimal to Binary, Decimal to Hexadecimal using Vb.Net

VB.NET AutoComplete TextBox in a DataGridView + MySQL Database
VB.NET Barcode Generator Print Product Label Using Crystal Report
GridView CRUD Operations in VB.NET using ADO.NET and MySQL Database
VB.NET Converter - How to create simple application that convert from Binary to Decimal or Binary to Hexadecimal, convert from Decimal to Binary or Decimal to Hexadecimal and Convert from Hexadecimal to Decimal or to Binary using Vb.Net windows application.

Please Read :
  1. Vb.Net how to split() Functions in vb.net
  2. Vb.Net how to read text file

Create VB.NET Converter Project

Now we will try to create new project in your visual studio and rename it with "NetConverter", then at the Form1.vb please design look like this picture :

VB.NET Convert From Binary, Decimal, and Hexadecimal

Source Code VB.NET Simple Converter

Just write all source code below to convert a value from TextBox1.text and showing into TextBox2.Text

Load Event


    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        ' Add items into ComboBox1
        ComboBox1.Items.Add("Binary")
        ComboBox1.Items.Add("Decimal")
        ComboBox1.Items.Add("Hexadecimal")
        ' Add items into ComboBox1
        ComboBox2.Items.Add("Binary")
        ComboBox2.Items.Add("Decimal")
        ComboBox2.Items.Add("Hexadecimal")
        ' Add Text into ComboBox1
        ComboBox1.Text = "Select Format"
        ' Add Text into ComboBox1
        ComboBox2.Text = "Select Format"
    End Sub

Button1 Click Event


    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim Strconvert As String = TextBox1.Text
        Dim Decimals As Integer
        Dim hexadecimal As String
        Dim Binary As String
        Dim x As Integer

        ' convert Binary to Binary
        If ComboBox1.Text = "Binary" And ComboBox2.Text = "Binary" Then
            TextBox2.Text = TextBox1.Text
            ' convert Binary to Decimal
        ElseIf ComboBox1.Text = "Binary" And ComboBox2.Text = "Decimal"
            Decimals = Convert.ToInt32(Strconvert, 2)
            TextBox2.Text = Decimals.ToString
            ' convert Binary to Hexadecimal
        ElseIf ComboBox1.Text = "Binary" And ComboBox2.Text = "Hexadecimal"
            Decimals = Convert.ToInt32(Strconvert, 2)
            hexadecimal = Convert.ToString(Decimals, 16)
            TextBox2.Text = hexadecimal
            ' convert Decimal to Binary
        ElseIf ComboBox1.Text = "Decimal" And ComboBox2.Text = "Binary"
            x = Convert.ToInt32(Strconvert)
            Binary = Convert.ToString(x, 2)
            TextBox2.Text = Binary
            ' convert Decimal to Hexadecimal
        ElseIf ComboBox1.Text = "Decimal" And ComboBox2.Text = "Hexadecimal"
            x = Convert.ToInt32(Strconvert)
            hexadecimal = Convert.ToString(x, 16)
            TextBox2.Text = hexadecimal
            ' convert Hexadecimal to Binary
        ElseIf ComboBox1.Text = "Hexadecimal" And ComboBox2.Text = "Binary"
            Decimals = Convert.ToInt32(Strconvert, 16)
            Binary = Convert.ToString(Decimals, 2)
            TextBox2.Text = Binary
            ' convert Hexadecimal to Decimal
        ElseIf ComboBox1.Text = "Hexadecimal" And ComboBox2.Text = "Decimal"
            Decimals = Convert.ToInt32(Strconvert, 16)
            TextBox2.Text = Decimals.ToString
        Else
            If ComboBox1.Text = "Select Format" Or ComboBox2.Text = "Select Format" Or ComboBox1.Text = "" Or ComboBox2.Text = "" Then
                MsgBox("Please Insert Select type to convert")
            End If
        End If
    End Sub

Just compile and run your application and show me what happend.

Download VB.NET Convert Full Source Code

Feel free to code it up and send us a pull request.

Hi everyone, let's me know how much this lesson can help your work. Please Subscribe and Follow Our Social Media 'kodeajaib[dot]com' to get Latest tutorials and will be send to your email everyday for free!, Just hit a comment if you have confused. Nice to meet you and Happy coding :) all ^^



Follow by E-Mail


COMMENTS

DISQUS
Name

ADO.NET,3,Ajax,6,Android,9,AngularJS,4,ASP.NET,4,Blogger Tutorials,7,Bootstrap,7,C++,1,Codeigniter,2,Cplusplus,6,Crystal Report,6,CSharp,25,Ebook Java,2,FlyExam,1,FSharp,3,Game Development,2,Java,35,JDBC,2,Laravel,89,Lumen,2,MariaDB,2,Ms Access,3,MySQL,31,ODBC,6,OleDB,1,PHP,14,PHP Framework,6,PHP MYSQLI,9,PHP OOP,5,Python,8,Python 3,4,SQL Server,4,SQLite,4,Uncategorized,5,Vb 6,2,Vb.Net,89,Video,48,Vue Js,4,WPF,2,Yii,3,
ltr
item
KODE AJAIB: VB.NET Convert From Binary, Decimal, and Hexadecimal
VB.NET Convert From Binary, Decimal, and Hexadecimal
VB.NET tutorials : How to convert Binary to Decimal, Binary to Hexadecimal and Decimal to Binary, Decimal to Hexadecimal using Vb.Net
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEip-ABcHQZAj2858B3fmnuTfGPYYGFi7_2C9tpQ2zIbtP8mZvAXBGv3y3oSjsLy0BqoFgwL_K_PzwpMtjD7tFeILlP4-HiKABoyWSNvUanBXRoT7b4HruKUJOBQEdZuZ3Pyje174glyDNs/s320/vb-net-converter.jpg
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEip-ABcHQZAj2858B3fmnuTfGPYYGFi7_2C9tpQ2zIbtP8mZvAXBGv3y3oSjsLy0BqoFgwL_K_PzwpMtjD7tFeILlP4-HiKABoyWSNvUanBXRoT7b4HruKUJOBQEdZuZ3Pyje174glyDNs/s72-c/vb-net-converter.jpg
KODE AJAIB
https://scqq.blogspot.com/2016/07/how-to-convert-from-binary-decimal-hexadecimal.html
https://scqq.blogspot.com/
https://scqq.blogspot.com/
https://scqq.blogspot.com/2016/07/how-to-convert-from-binary-decimal-hexadecimal.html
true
3214704946184383982
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS CONTENT IS PREMIUM Please share to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy