-->

Sponsor Alanı

Slider

İlgi Çeken Videolar

Sağlık

Teknoloji

Sinema

Televizyon

Ne Nedir?

En5 Konular

ads

Radyo ve Tv Programı Vb.Net İle

Visual basic 2010 ile  Tv ve Radyo Programı Yapmak

Radyo ve Tv Programı Vb.Net İle
Bu derste kısaca vb.net ile radyo ve tv programı yapmayı göstereceğiz. Öncelikle ilk yapmanız gereken forma 1 adet  WindowsMediaPlayer eklemeniz gerekmekte. Eğer programınızda bulunmuyorsa aşağıdaki video da nasıl toolbox'a ekleyeceğinizi gösterdim.  ve kaç tv ve radyo eklemek istiyorsanız ona göre button ekleyeceksiniz. Ben sadece bir button ve bir kanal ekledim örnek olması açısından



Aşağıdaki örnek kodu buttona çift tıklayarak click olayına ekliyorsunuz.

AxWindowsMediaPlayer1.URL = ("http://212.175.166.3/TV1")


WindowsMediaPlayer ToolBox'a nasıl Eklenir Video


Doğum Günü Hesaplama (Vb.Net)

Gün hesaplama Programı Yapma - Visual basic ile.

Bu yazımızda basit bir gün hesaplama programı yapacağız. Hangi günde doğduğunuzu gösteren basit ve kullanışlı bir programı hep beraber yapalım.

Forma eklemeniz gereken araçlar:

1 tane TextBox
2 tane Button
ve 2 tane Label ekleyerek  tasarımı aşağıdaki gibi yapıyoruz.

Doğum Günü Hesaplama (Vb.Net)

Yazmanız gereken kodlar aşağıda:

Public class form1

  Dim d_tarih, gun

button1_click

        Do
            d_tarih = TextBox1.Text
        Loop While Not IsDate(d_tarih)
        Select Case Weekday(d_tarih)
            Case 1 : gun = "Pazar"
            Case 2 : gun = "Pazartesi"
            Case 3 : gun = "Salı"
            Case 4 : gun = "Çarşamba"
            Case 5 : gun = "Perşembe"
            Case 6 : gun = "Cuma"
            Case 7 : gun = "Cumartesi"
        End Select
        MsgBox(gun & " Günü Doğmuşsunuz", MsgBoxStyle.Information, "SONUÇ")

button2_click

    d_tarih = TextBox1.Text
        If d_tarih <= Now.Date Then
            MsgBox("Daha geçerli bir tarih giriniz.")
        Else
            Do
            Loop While Not IsDate(d_tarih)
            Select Case Weekday(d_tarih)
                Case 1 : gun = "Pazar"
                Case 2 : gun = "Pazartesi"
                Case 3 : gun = "Salı"
                Case 4 : gun = "Çarşamba"
                Case 5 : gun = "Perşembe"
                Case 6 : gun = "Cuma"
                Case 7 : gun = "Cumartesi"
            End Select
            MsgBox(gun & " Günü Doğum Gününüz.", MsgBoxStyle.Information, "SONUÇ")
        End If


Visual Basic ile Sayı Oyunu Yapma

Vb.Net 2010 - Sayı Oyunu Yapımı


Bu dersimizde  basit bir  sayı oyunu yapmayı işleyeceğiz.   Oyun sayı tahmin oyunudur.  Visual basic 2010 ile yazacağız.

Forma eklemeniz gerekenler:

1 Adet Button
3 adet Textbox
1 adet Label
1 tanede ListBox ekleyin ve form tasarımını aşağıdaki gibi yapabilirsiniz.

Visual Basic ile Sayı Oyunu Yapma

İlk olarak eklemeniz kod en üst bölüme aşağıdaki kodu ekleyiniz.

Dim tahmin As Integer
    Dim tutulan As Integer
    Dim level As Integer = 1
    Dim a As Integer
    Sub sayiuret()   'Random sayıları üret
        Randomize()
        a = Rnd() * 100
        tutulan = a * level
    End Sub


Sonrasında form'a çift tıklayın ve kod bölümüne aşağıdaki kodu yazınız.

sayiuret()


Son yazmanız gereken kodu Buttona çift tıklayarak görünen bölüme yazınız.


tahmin = TextBox1.Text

        If level <= 3 Then

            Select Case tahmin

                Case Is < tutulan
                    TextBox3.Text = "Yukari"

                Case Is > tutulan
                    TextBox3.Text = "Asagi"

                Case Else
                    TextBox3.Text = "Başardınız"
                    ListBox1.Items.Add(level & ". Tebrikler Level'i geçtiniz.")
                    level += 1
                    sayiuret()

            End Select
            TextBox2.Text = level

        Else

            MsgBox("The End..")

        End If

Araba Yarışı Yapmak ( Vb.Net )

Visual basic 2010 ile basit bir araba yarışı yapacağız.

Forma eklemeniz gerken araçlar:

3 tane LineShape
2 adet Textbox
1 adet Timer ekleyiniz ve tasarımı aşağıdaki gibi yapabilirsiniz.

Araba Yarışı Yapmak ( Vb.Net )


Aşağıda verilmiş olan kodu Timer e ekleyiniz.

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Randomize()
a = Int(Rnd(300) * 100)
b = Int(Rnd(300) * 100)
TextBox1.Left = TextBox1.Left + a
TextBox2.Left = TextBox2.Left + b
If TextBox1.Left >= 5520 Then
a = MsgBox("A Arabası kazandı")
End
End If
If TextBox2.Left >= 5520 Then
a = MsgBox("B Arabası Kazandı")
End
End If
End Sub


Sonrasında ekleyeceğiniz kodu Buttona çift tıklayın ve click olayına ekleyin

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Enabled = True
Timer1.Interval = 25
End Sub
End Class


Faktöriyel Hesaplama ( Vb.Net )

Bu derste Visual basic 2010 ile Faktöriyel hesaplamaya yarayan basit bir program yapmayı göstereceğiz.

Eklemeniz gereken araçlar:

* 3 adet Label
* 2 Adet Textbox
* 1 Adet Button

tasarımı aşağıdaki gibi yapabilirsiniz.

Faktöriyel Hesaplama ( Vb.Net )


Aşağıdaki kodu Formun kod kısmına yapıştırın.

Private Function faktoriyel()
faktoriyel = 1
For i = 1 To Textbox1
faktoriyel = faktoriyel * i
Next
End Function

Private Sub Button1_Click()
Textbox2 = faktoriyel
End Sub

Private Sub Form_Load()
End Sub

Final ve Vize Not Hesaplama ( Vb.Net )

Visual Basic ile Vize ve final notlarını hesaplayan program yapımı

Aşağıda verilmiş olan kodları form'da eklediğiniz Buttonun içine ekleyiniz.

Private Sub Command2_Click()
Dim V, y, f
V = InputBox("Vize değerinizi girin", " işte vize notunuz", "0")
f = InputBox("Final notu girin", "işte final notunuz", "0")
y = (V * 0.3) + (f * 0.7)
MsgBox y
Select Case y
Case 0: MsgBox ("çok Kötü")
Case 1 To 24: MsgBox (" az Kötü")
Case 25 To 44: MsgBox ("Fena sayılmaz")
Case 45 To 54: MsgBox (" Geçerli not")
Case 55 To 69: MsgBox (" Az Fena Değil")
Case 70 To 84: MsgBox (" Normal")
Case 85 To 100: MsgBox ("tebrikler süper")
Case Else: MsgBox ("Yanlış not girdiniz")
End Select
End Sub

Sayısal Loto Programı

Visual basic İle Sayısal Loto Programı Yapımı


Bu dersimizde sayısal loto programının yapını göreceğiz.

Forma eklemeniz gereken araçlar

6 Tane TextBox - Yan Yana dizilecek
7 tane Label Ekleyin - Her birini texbox'ların altına ve 7. Label'ı en alta ekleyin tasarımı aşağıdaki gibi yapabilirsiniz.

Sayısal Loto Programı

Kodlama:

Public Class Form1
    '6 adet sayının tutulacağı 6 değişken tanımladık.
    Dim a As Integer
    Dim b As Integer
    Dim c As Integer
    Dim d As Integer
    Dim x As Integer
    Dim f As Integer

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click


      
        Randomize()
        a = Rnd() * 49

        
back1:
        Randomize()
        b = Rnd() * 49

        If b = a Or b = 0 Then
            GoTo back1
        End If

        'ÜÇÜNCÜ SAYIMIZI ÇEKİYORUZ. ÖNCEKİ SAYILARA VE 0'A EÞİT OLMASI DURUMUNDA YENİDEN ÇEKİLİÃŞ YAPILACAK. 
back2:
        Randomize()
        c = Rnd() * 49

        If c = a Or c = b Or c = 0 Then
            GoTo back2
        End If

        'DİĞER SAYILARIMIZI ÇEKMEYE DEVAM EDELİM.
back3:  Randomize()
        d = Rnd() * 49

        If d = a Or d = b Or d = c Or d = 0 Then
            GoTo back3
        End If


back4:
        Randomize()
        x = Rnd() * 49

        If x = a Or x = b Or x = c Or x = d Or x = 0 Then
            GoTo back4
        End If


back5:
        Randomize()
        f = Rnd() * 49

        If f = a Or f = b Or f = c Or f = d Or f = x Or f = 0 Then
            GoTo back5
        End If
    End Sub


   

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

       
        Dim tutan As Integer
        tutan = 0

        'GİRİLEN SAYILARIN ALTINDAKİ LABEL'LARDA ÇEKİLİŞTE ÇIKACAK SAYILAR BELİRLENECEK.
        Label1.Text = a
        Label2.Text = b
        Label3.Text = c
        Label4.Text = d
        Label5.Text = x
        Label6.Text = f

           

        If TextBox1.Text = a Or TextBox2.Text = a Or TextBox3.Text = a Or TextBox4.Text = a Or TextBox5.Text = a Or TextBox6.Text = a Then
            tutan = tutan + 1
        End If
        If TextBox1.Text = b Or TextBox2.Text = b Or TextBox3.Text = b Or TextBox4.Text = b Or TextBox5.Text = b Or TextBox6.Text = b Then
            tutan = tutan + 1
        End If
        If TextBox1.Text = c Or TextBox2.Text = c Or TextBox3.Text = c Or TextBox4.Text = c Or TextBox5.Text = c Or TextBox6.Text = c Then
            tutan = tutan + 1
        End If
        If TextBox1.Text = d Or TextBox2.Text = d Or TextBox3.Text = d Or TextBox4.Text = d Or TextBox5.Text = d Or TextBox6.Text = d Then
            tutan = tutan + 1
        End If
        If TextBox1.Text = x Or TextBox2.Text = x Or TextBox3.Text = x Or TextBox4.Text = x Or TextBox5.Text = x Or TextBox6.Text = x Then
            tutan = tutan + 1
        End If
        If TextBox1.Text = f Or TextBox2.Text = f Or TextBox3.Text = f Or TextBox4.Text = f Or TextBox5.Text = f Or TextBox6.Text = f Then
            tutan = tutan + 1
        End If

        Label7.Text = tutan & " adet sayi tutturdunuz"

    End Sub
End Class


Rakamları Büyükten Küçüğe Sıralamak - Vb.Net

Bu derste basit bir işlem ile Sayıları büyükten küçüğe sıralamayı göreceğiz.

Rakamları Büyükten Küçüğe Sıralamak - Vb.Net

Forma eklemeniz gereken araçlar:

1 tane ListBox
1 tane Button

Kodlama:

Dim sayi(10) As Long 'sayi(10) indisli değişken anlamına gelir'
 For i=1 to 10
  sayi(i)=Inputbox(i & ".Tebrikler sayı girişi başarılı...")'sayılar alınıyor...
 Next
 For i=1 to 10
 For j=1 to 10
 
 if sayi(i) > sayi(j) then
     yedek=sayi(j)
     sayi(j)=sayi(i)
     sayi(i)=yedek
 end if
 
 Next j
 Next i
 for k=1 to 10
   List1.additem sayi(k)
 Next