VB KODLARI
Hazırlayan:ibrahim Ozcicek & Ercan Yigit & Ahmet Samak --------------------------------------------
Yuzde hesaplama
Private Sub Command1_Click()
dim a as integer
a= Val(Text1.Text)
Label1.Caption = a * 0.18
End Sub
Yazı boyutunu buyutme
Private Sub Form_Load()
List1.AddItem "8"
List1.AddItem "12"
List1.AddItem "16"
List2.AddItem "kalın"
List2.AddItem "italik"
List2.AddItem "normal"
End Sub
Private Sub List1_Click()
If List1.ListIndex = 0 Then
Text1.FontSize = 8
ElseIf List1.ListIndex = 1 Then
Text1.FontSize = 12
ElseIf List1.ListIndex = 2 Then
Text1.FontSize = 16
End If
End Sub
Private Sub List2_Click()
If List2.ListIndex = 0 Then
Text1.FontBold = True
ElseIf List2.ListIndex = 2 Then
Text1.FontBold = False
ElseIf List2.ListIndex = 3 Then
Text1.FontItalic = False
End If
End Sub
----------------------------------------
Yuvarlama
Private Sub Command1_Click()
dim bolen,bolunen as integer
bolen= val (text1.text)
bolunen=val(text2.text)
text3.text= ( a/b)- a mod (b) =
text4.text= a mod (b) =
end sub
Form gecişi
Form.show
---------------------------------------------------
Acılan listeyle bil.parcalarını gorme
Private Sub Form_Load()
List1.AddItem "pc"
List1.AddItem "mac"
List1.AddItem "mainfrome"
End Sub
Private Sub List1_Click()
If List1.ListIndex = 0 Then
List2.AddItem "winxp,win2000,win98,win2003"
ElseIf List1.ListIndex = 1 Then
List2.AddItem "apple2,apple2.5"
ElseIf List1.ListIndex = 2 Then
List2.AddItem "unix,server,"
End If
End sub
-----------------------------------------------------
Sayının negatif veya poztif olduğunu gosteren program
Private Sub Command1_Click()
Dim sayı as integer
Sayi =inputbox (“bir sayi giriniz”)
İf sayi > 0 then
Msgbox (“bu sayi pozitif”)
Elseif sayi < 0 then
Msgbox (“bu sayi negatiftir”)
Else
Msgbox (“sayi 0 dır”)
End if
End sub
Bir sayının 10 a bolumunu kontrol etmek
Private Sub Command1_Click()
Dim a as integer
a=val (text1.text)
if a mod (10) =0 then
Msgbox (“sayi 10 a bolunur”)
else
Msgbox (“sayi 10 a tam olarak bolunmez”)
end if
end sub
-----------------------------------------------
resim goster
Private Sub check1_Click()
İmage1.visible=true
İmage2.visible=false
İmage3.visible=false
Private Sub check2_Click()
İmage1.visible=false
İmage2.visible=true
İmage3.visible=false
Private Sub check3_Click()
İmage1.visible=false
İmage2.visible=false
İmage3.visible=true
-----------------------------------------------

__________________