Select Case Kullanımı
1 sayfadaki 1 sayfası
Select Case Kullanımı
KULLANIMI:
select case seçilen yer
cose koşul1
işlem
case koşul2
işlem
cese else :yuarıdakilerenden hiçbiriyse
işlem
End Select
ÖRNEK:
Bir button, 2 adet textbox ekleyin butona çift tıklayın(click olayına) ve aşağıdaki kodu yazın
Dim a, b, toplam As Integer
a = TextBox1.Text
b = TextBox2.Text
toplam = (a b) / 2
Select Case toplam
Case 1 To 24
MsgBox("geçersiz"&)
Case 25 To 44
MsgBox("Zayıf")
Case 45 To 54
MsgBox("Geçer")
Case 55 To 69
MsgBox("Orta")
Case 70 To 84
MsgBox("iyi")
Case 85 To 100
MsgBox("Pekiyi")
Case Else
MsgBox("100 Den Yukarı sayı not sayılmaz")
MsgBox("21.yy")
End Select
select case seçilen yer
cose koşul1
işlem
case koşul2
işlem
cese else :yuarıdakilerenden hiçbiriyse
işlem
End Select
ÖRNEK:
Bir button, 2 adet textbox ekleyin butona çift tıklayın(click olayına) ve aşağıdaki kodu yazın
Dim a, b, toplam As Integer
a = TextBox1.Text
b = TextBox2.Text
toplam = (a b) / 2
Select Case toplam
Case 1 To 24
MsgBox("geçersiz"&)
Case 25 To 44
MsgBox("Zayıf")
Case 45 To 54
MsgBox("Geçer")
Case 55 To 69
MsgBox("Orta")
Case 70 To 84
MsgBox("iyi")
Case 85 To 100
MsgBox("Pekiyi")
Case Else
MsgBox("100 Den Yukarı sayı not sayılmaz")
MsgBox("21.yy")
End Select
1 sayfadaki 1 sayfası
Bu forumun müsaadesi var:
Bu forumdaki mesajlara cevap veremezsiniz