Pengikut

Ahad, 29 Julai 2012

Kata babai untuk VB!!!


Owh, ari ney sgt syorga smpai aku rasa mcm nk nari joget, eh, rasa mcm nk lompat bintang..eh rasa nk snyum smpai mulut cramp..^-^

Hari ney last day aku ngajaq student programming aku, pas ney dh xyah meroyan pikiaq code vb dh. Program ney simple ja sebenaqnya, bila toke restoren 'tick' chkbox, program ney akn calculate suma bil kita sekaligus! dh xyah ingat harga satu~satu...



*******************************************





Code:


Private Sub cmdCalculate_Click()
  Dim itotal As Double
    
    If chkAyam.Value = 1 Then
        itotal = itotal + 3.5
    End If
    
    If chkSayuran.Value = 1 Then
        itotal = itotal + 3#
    End If
    
    If chkBiasa.Value = 1 Then
        itotal = itotal + 2#
    End If
    
    If chkBriyani.Value = 1 Then
        itotal = itotal + 3#
    End If
    
    If chkSup.Value = 1 Then
        itotal = itotal + 4#
    End If
    Text1.Text = itotal
    
  Dim utotal As Double
    
    If chkTeh.Value = 1 Then
        utotal = utotal + 0.7
    End If
    
    If chkNescafe.Value = 1 Then
        utotal = utotal + 0.9
    End If
    
    If chkMilo.Value = 1 Then
        utotal = utotal + 0.8
    End If
    
    If chkMilk.Value = 1 Then
        utotal = utotal + 0.6
    End If
    
    If chkKacang.Value = 1 Then
        utotal = utotal + 1.2
    End If
    Text2.Text = utotal
    
    Text3.Text = itotal + utotal
End Sub


Part clear ney aku xpuas hati cket la...bila kita clear suma item dlm textbox dibuang tp 'tick' dlm checkbox still ada...yg tue nntilah

Code Clear:

Private Sub cmdClear_Click()
    Text1.Text = ""
    Text2.Text = ""
    Text3.Text = ""
End Sub


Aku dh lama tinggal vb, tak silap dh 5taun..bye!

2 ulasan:

Fasihah Ismail berkata...

Perghhh...cikgu VB :D

Nur Abu Bakar berkata...

hahaha, cikgu lah sgt....

nurabubakar.blogspot.com