Rabu, 08 Agustus 2012

Program Pengubah Suhu


Awalnya ini merupakan tugas kuliah, tugasnya disuruh membuat program bebas dari VB.NET .
Matakuliah   :Interaksi Manusia dan Komputer
Dosen           : Desi Anggraini S.KOM

yaudah... ane milih buat program yg simpel aja yaitu "Temperature Converter "
Langsung aja dech... Lansung aja ke topik..>> cekiidoooot...
disini kita akan menggunakan Microsoft visual studio 2010 ultimate.

Langkah-langkahnya
 - buka Microsoft Visual Studio 2010,-Pada menu file, pilih New Open Project ,  (lih. Gbr)














-          Pada New project , pilih windows form application .
-          Kemudian dibawah, tentukan nama program dan lokasinya. 
















Desain form seperti Nampak pada gambar  di berikut, dan aturlah tab ordernya seperti gambar selanjutnya. Untuk memperlihatkan tab order, gunakan menu view > tab order.

 
Atau nanti kamu bisa berikan variasi form kamu sendiri… :D
-berikut gambar tab ordernya 
 

















 - kemudian ubahlah  beberapa property kontrolnya
Kontrol
Properti
Nilai
Radiobutton1
Name
Text
checked
btnCelcius
Celcius
false
Radiobutton2
Name
Text
checked
btnFahrenheit
Fahrenheit
false
Radiobutton3
Name
Text
checked
btnKelvin
Kelvin (T)
False
Radiobutton4
Name
Text
checked
btnReamur
Reamur
false
Textbox
Name
text
NilaiSuhu
Button
Name
text
Cmd
konversi
Label1
Name
Text
Autosize
LabelCelcius
C
false
Label2
Name
Text
Autosize
LabelFahrenheit
F
False
Label3
Name
Text
Autosize
LabelKelvin
K(T)
False
Label4
Name
Text
Autosize
LabelReamur
R
False
Button1
Name
Text
Button1
EXIT
Button2
Name
Text
Button2
about


































 
 - langkah selanjutnya :
copykan listing programnya:

Public Class tombol_ubah

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

    End Sub
    ''' pasan pada tombol exit '''
    Private Sub Form_closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
        If MsgBox("yakin loe mau Keluar?", MsgBoxStyle.Information Or MsgBoxStyle.OkCancel) = MsgBoxResult.Ok Then
            e.Cancel = False
        Else
            e.Cancel = True
        End If

    End Sub

    Private Sub GroupBox1_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GroupBox1.Enter

    End Sub

    Private Sub btnCelcius_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
        cmd.Enabled = True
    End Sub

    Private Sub btnFahrenheit_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
        cmd.Enabled = True
    End Sub

    Private Sub btnKelvin_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
        cmd.Enabled = True
    End Sub

    Private Sub NilaiSuhu_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)

    End Sub

    Private Sub cmd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmd.Click
        Dim box As Double
        Dim sum As Double
        Dim sum2 As Double
        Dim sum3 As Double
        If NilaiSuhu.Text = "" Then
            MsgBox("Nilainya Harus di isi coy...! :D", vbOKOnly)

        Else
            box = Convert.ToDouble(NilaiSuhu.Text)
            If btnCelcius.Checked = True Then
                LabelCelsius.Text = box
                sum = (box * 1.8) + 32
                LabelFahrenheit.Text = sum
                sum2 = box + 273.15
                LabelKelvin.Text = sum2
                sum3 = box * 0.8
                LabelReamur.Text = sum3

            End If
            If btnFahrenheit.Checked = True Then
                LabelFahrenheit.Text = box
                sum = (box - 32) / 1.8
                LabelCelsius().Text = sum
                sum2 = box + 273.15
                LabelKelvin.Text = sum2
                sum3 = (box - 32) / 2.25
                LabelReamur.Text = sum3
            End If
            If btnKelvin.Checked = True Then
                LabelKelvin.Text = box
                sum = box - 273.15
                LabelCelsius.Text = sum
                sum2 = (box * 9) / 5 + 32
                LabelFahrenheit.Text = sum2
                sum3 = (box - 273.15) * 0.8
                LabelReamur.Text = sum3
            End If
            If btnReamur.Checked = True Then
                LabelReamur.Text = box
                sum = box / 0.8
                LabelCelsius.Text = sum
                sum2 = (box * 2.25) + 32
                LabelFahrenheit.Text = sum2
                sum3 = (box / 0.8) + 273.15
                LabelKelvin.Text = sum3

            End If
        End If
    End Sub

    Private Sub LabelReamur_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label3.Click

    End Sub

    Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFahrenheit.CheckedChanged
        cmd.Enabled = True
    End Sub

    Private Sub RadioButton1_CheckedChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnReamur.CheckedChanged
        cmd.Enabled = True
    End Sub

    Private Sub NilaiSuhu_TextChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NilaiSuhu.TextChanged

    End Sub

    Private Sub btnCelcius_CheckedChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCelcius.CheckedChanged
        cmd.Enabled = True
    End Sub

    Private Sub btnKelvin_CheckedChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnKelvin.CheckedChanged
        cmd.Enabled = True
    End Sub

    Private Sub LabelCelsius_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LabelCelsius.Click

    End Sub

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

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        MsgBox("Program Temperature Convertor, Created Anggit Nataperdana", vbOKOnly)
    End Sub
End Class
-------------------------------

lalu coba run... dan beginilah hasilnya... ^_^


















 

About Chuck


Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut odio. Nam sed est. Nam a risus et est iaculis adipiscing. Vestibulum ante ipsum faucibus luctus et ultrices.
View all posts by Chuck →

0 komentar:

Text Widget

Recent Articles

About Us

© 2014 Mari Mampir. WP Wildweblab converted by Bloggertheme9