Selasa, 28 Mei 2013

Cara Membuat Perhitungan HEXA,DESIMAL,OKTAL,BINER Dengan Visual Studio


Cara Membuat Perhitungan HEXA,DESIMAL,OKTAL,BINER Dengan Visual Studio

Desain lah Form Berikut :

Ketikkan Program Berikut :

Public Class Form 1

    Private Sub BtnHEXA_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnHEXA.Click
        bil_out.Text = Hex(Val(bil_input.Text))
    End Sub

    Private Sub BtnKeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnKeluar.Click
        End
    End Sub

    Private Sub BtnOctal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnOctal.Click
        bil_out.Text = Oct(Val(bil_input.Text))
    End Sub

    Private Sub Btn_Decimal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn_Decimal.Click
        Dim xHexa As String = Hex(Val(bil_input.Text))
        Dim xBin As String
        Dim xbin2 As String
        Dim xKata As String
        Dim i As Integer
        xbin2 = ""
        For i = 1 To Len(xHexa)
            xBin = ""
            xKata = Mid(xHexa, i, 1)
            Select Case UCase(xKata)
                Case "0"
                    xBin = "0000"
                Case "1"
                    xBin = "0001"
                Case "2"
                    xBin = "0010"
                Case "3"
                    xBin = "0011"
                Case "4"
                    xBin = "0100"
                Case "5"
                    xBin = "0101"
                Case "6"
                    xBin = "0110"
                Case "7"
                    xBin = "0111"
                Case "8"
                    xBin = "1000"
                Case "9"
                    xBin = "1001"
                Case "A"
                    xBin = "1010"
                Case "B"
                    xBin = "1011"
                Case "C"
                    xBin = "1100"
                Case "D"
                    xBin = "1101"
                Case "E"
                    xBin = "1110"
                Case "F"
                    xBin = "1111"
                Case "h", "H"
                    xBin = ""
                Case Else
                    xBin = ""
            End Select
            xbin2 = xbin2 + xBin
        Next i

        bil_out.Text = xbin2
    End Sub

    Private Sub biner_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles biner.Click
        bil_out.Text = (Val(bil_input.Text))
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub
End Class


Terkait

Description: Cara Membuat Perhitungan HEXA,DESIMAL,OKTAL,BINER Dengan Visual Studio Rating: 4.5 Reviewer: annajmin zega ItemReviewed: Cara Membuat Perhitungan HEXA,DESIMAL,OKTAL,BINER Dengan Visual Studio
Al
Mbah Qopet Updated at: 5/28/2013 09:58:00 PM

0 komentar :

Poskan Komentar