Thursday, December 16, 2010

making powers calculator with visual basic 6.0

Open a visual basic program, then make is Form1, Form1 add the following objects:

  • 3  labels
  • 2 command button, 
  • 2 text box
then fill propertiesnya as follows:

Objek                  Name                       Caption
Label1                 Label1                  MasukanX
Label2                  Label2                    MasukanY
Label3              Labelhasil                Hasil
Text1                    TxtY                     Kosongkan
Text2                   txtX                   Kosongkan
Command1          cmdHitung             Hitung
Command2         Cmdkeluar               Keluar


See the following picture:
Then type the following code listing:

Private sub cmdHItung_click()
Labelhasil.caption=val(txtX.text) ^val (txtY.text)
End sub
Private sub cmdkeluar_click()
End
End sub


simple enough right?

hopefully easy to understand

No comments:

Post a Comment