22 Temmuz 2013 Pazartesi

Değiken Kullanımına Bağlı ToUpper Ve ToLower Kullanımı

Gerekenler 1 Buton.
------------------------------------------------------------------------------------------------------------
Public Class Form1

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

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim veri As String
        veri = InputBox("NASILSINIZ?")
        If veri.ToUpper.CompareTo("İYİM") = 0 Then
            MsgBox("ALLAH İYİLİK VERSİN :)")
        Else
            MsgBox("GEÇMİŞ OLSUN :(")
        End If
    End Sub
End Class
------------------------------------------------------------------------------------------------------------

21 Temmuz 2013 Pazar

FAKTORİYEL HESAPLAYICI


Gerekenler 1 Buton ve 1 tane Textbox

------------------------------------------------------------------------------------------------------------
Public Class Form1

    Function faktöriyel(ByVal sayı As Integer) As Integer
        Dim sayac, islem As Integer
        islem = 1
        For sayac = 1 To sayı
            islem = sayac * islem
        Next
        Return islem
    End Function


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim deger As Integer
        deger = TextBox1.Text
        Dim sonuc As Integer
        sonuc = faktöriyel(deger)
        TextBox1.Text = sonuc

    End Sub
End Class
------------------------------------------------------------------------------------------------------------