Donanım Merkezi
 

Geri git   Donanım Merkezi > Yazılım > Programlama

Cevapla
 
LinkBack Seçenekler Stil
Alt 11-27-2004, 01:34 PM   #1 (permalink)
Donanımcı
 
Üyelik tarihi: Nov 2004
Nerden: Ankara
Mesajlar: 502
İtibar Gücü: 0 C@GL@R is an unknown quantity at this point
C@GL@R - İCQ üzeri Mesaj gönder C@GL@R - MSN üzeri Mesaj gönder
VB Program Örnek

ALANLAR
Dim b As Double
Dim c As Double
Private Sub txtdai_pisayısıs_KeyPress(KeyAscii As Integer)
If KeyAscii <> 8 Then
If Not IsNumeric(Chr(KeyAscii)) Then KeyAscii = 0
End If
End Sub

Private Sub cmdhesap_Click()
b = Val(txtdik_kenar1.Text)
c = Val(txtdik_kenar2.Text)
txtdik_sonuc.Text = b * c
txtdik_sonuc.SetFocus
End Sub
Private Sub cmddiktemizle_Click()
txtdik_kenar1.Text = ""
txtdik_kenar2.Text = ""
txtdik_sonuc = ""
txtdik_kenar1.SetFocus
End Sub

Private Sub Form_Load()
txtdai_pisayısıs.Text = "3,1415"
End Sub

Private Sub cmdkarehesapla_Click()
Dim c As Integer
c = Val(txtkare_kenar.Text)
txtkare_sonuc = c * c
End Sub
Private Sub cmdkareTemizle_Click()
txtkare_kenar.Text = ""
txtkare_sonuc.Text = ""
End Sub
Private Sub cmddaihesap_Click()
If txtdai_yarıcap.Text = "" Then
txtdai_yarıcap.Text = ""
Else
txtdai_sonuc.Text = CDbl(txtdai_pisayısıs.Text) * CDbl(txtdai_yarıcap.Text)
End If
End Sub
Private Sub cmddaitemizle_Click()
txtdai_yarıcap.Text = ""
txtdai_sonuc.Text = ""
End Sub
Private Sub cmddikuchesapla_Click()
Dim w, c As Integer
w = Val(txtdikuc_taban.Text)
c = Val(txtdikuc_yuksel.Text)
txtdikuc_sonuc.Text = w * c / 2
End Sub
Private Sub cmddikucsonuc_Click()
txtdikuc_taban.Text = ""
txtdikuc_yuksel.Text = ""
txtdikuc_sonuc.Text = ""
End Sub
Private Sub Form_Unload(Cancel As Integer)
frmhesap.Visible = True
frmhesap.Enabled = True
End Sub
Private Sub txtdai_yarıcap_KeyPress(KeyAscii As Integer)
If KeyAscii <> 8 Then
If Not IsNumeric(Chr(KeyAscii)) Then KeyAscii = 0
End If
End Sub

Private Sub txtdik_kenar1_KeyPress(KeyAscii As Integer)
If KeyAscii <> 8 Then
If Not IsNumeric(Chr(KeyAscii)) Then KeyAscii = 0
End If
End Sub

Private Sub txtdik_kenar2_KeyPress(KeyAscii As Integer)
If KeyAscii <> 8 Then
If Not IsNumeric(Chr(KeyAscii)) Then KeyAscii = 0
End If
End Sub
Private Sub txtdikuc_taban_KeyPress(KeyAscii As Integer)
If KeyAscii <> 8 Then
If Not IsNumeric(Chr(KeyAscii)) Then KeyAscii = 0
End If
End Sub

Private Sub txtdikuc_yuksel_KeyPress(KeyAscii As Integer)
If KeyAscii <> 8 Then
If Not IsNumeric(Chr(KeyAscii)) Then KeyAscii = 0
End If
End Sub

Private Sub txtkare_kenar_KeyPress(KeyAscii As Integer)
If KeyAscii <> 8 Then
If Not IsNumeric(Chr(KeyAscii)) Then KeyAscii = 0
End If
End Sub
Döviz İşlemleri
Dim a, b As Double
Private Sub cmdhesapla_Click()
If txtkur.Text = "" Then
txtkur = ""
Else
a = txtkur.Text
b = txtmiktar.Text
txtsonuc.Text = a * b
End If
txtsonuc.SetFocus
End Sub

Private Sub cmdtemizle_Click()
txtmiktar.Text = ""
txtkur.Text = ""
txtsonuc.Text = ""
txtsonuc.SetFocus
txtkur.SetFocus
End Sub

Private Sub Form_Unload(Cancel As Integer)
frmhesap.Visible = True
frmhesap.Enabled = True
End Sub

Private Sub txtkur_KeyPress(KeyAscii As Integer)
If KeyAscii <> 8 Then
If Not IsNumeric(Chr(KeyAscii)) Then KeyAscii = 0
End If
End Sub

Private Sub txtmiktar_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
a = txtkur.Text
b = txtmiktar.Text
txtsonuc.Text = a * b
txtsonuc.SetFocus
End If
If KeyAscii <> 8 Then
If Not IsNumeric(Chr(KeyAscii)) Then KeyAscii = 0
End If
End Sub

Private Sub txtsonuc_Change()
txtsonuc.Text = Format(txtsonuc.Text, "###,###")
txtsonuc.SelStart = Len(txtsonuc.Text)
End Sub

Private Sub txtsonuc_KeyPress(KeyAscii As Integer)
If KeyAscii = 27 Then
txtkur.Text = ""
txtmiktar.Text = ""
txtsonuc.Text = ""
txtkur.SetFocus
End If
If KeyAscii <> 8 Then
If Not IsNumeric(Chr(KeyAscii)) Then KeyAscii = 0
End If
txtsonuc.SetFocus
End Sub

Frm Hesap
Dim b As Double
Dim c As Double
Private Sub cmdaltı_Click()
txtgir.Text = txtgir.Text & 6
Me.txtgir.SetFocus
End Sub
Private Sub cmdbes_Click()
txtgir.Text = txtgir.Text & 5
Me.txtgir.SetFocus
End Sub
Private Sub cmdbir_Click()
txtgir.Text = txtgir.Text & 1
Me.txtgir.SetFocus
End Sub
Private Sub cmdbol_Click()
b = txtgir.Text
txtgir.Text = ""
lblisaret.Caption = "/"
Me.txtgir.SetFocus
End Sub
Private Sub cmdcarp_Click()
b = txtgir.Text
txtgir.Text = ""
lblisaret.Caption = "*"
Me.txtgir.SetFocus
End Sub
Private Sub cmdcıkar_Click()
b = txtgir.Text
txtgir.Text = ""
lblisaret.Caption = "-"
Me.txtgir.SetFocus
End Sub
Private Sub cmdCotanjant_Click()
f = txtgir.Text
b = 1 / Tan(f * 3.1415 / 180)
txtgir.Text = ""
txtgir.Text = b
Me.txtgir.SetFocus
End Sub
Private Sub cmdfaktoryel_Click()
a = txtgir.Text
s = 1
For i = 1 To a
s = s * i
Next
txtgir.Text = s
txtgir.SetFocus
End Sub

Private Sub Form_KeyPress(KeyAscii As Integer)
If KeyAscii = 27 Then
txtgir.Text = ""
End If
End Sub

Private Sub Form_Unload(Cancel As Integer)
For i = 1 To 150
frmhesap.Width = frmhesap.Width - i
frmhesap.Height = frmhesap.Height - i
Next
End Sub

Private Sub txtgir_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 190 Then
MsgBox ("Virgüllü Hesaplamalar için Hesaplamalar/Virgüllü Hesaplamalara gidiniz")
txtgir.Text = ""
End If
End Sub
Private Sub mnhakkında_Click()
frmhesap.Enabled = False
frmhesap.Visible = False
Bilgi.Show
End Sub
Private Sub mnvirgül_Click()
frmhesap.Enabled = False
frmhesap.Visible = False
frmvirgül.Show
End Sub
Private Sub cmdsinx_Click()
If txtgir.Text = 90 Then
txtgir.Text = "1"
Else
If txtgir.Text = 180 Then
txtgir.Text = "0"
Else
If txtgir.Text = 30 Then
txtgir.Text = "0,5"
Else
f = Val(txtgir.Text)
b = (Sin(f * 3.1415 / 180))
txtgir.Text = ""
txtgir.Text = b
End If
End If
End If
Me.txtgir.SetFocus
End Sub
Private Sub cmdcosx_Click()
f = txtgir.Text
If f = 90 Then
txtgir.Text = "0"
Else
If f = 270 Then
txtgir.Text = "0"
Else
If f = 180 Then
txtgir.Text = "-1"
Else
b = Cos(f * 3.1415 / 180)
txtgir.Text = ""
txtgir.Text = b
End If
End If
End If
Me.txtgir.SetFocus
End Sub
Private Sub cmdtanj_Click()
f = txtgir.Text
If f = 270 Then
txtgir.Text = "İşlevsiz"
Else
If f = 90 Then
txtgir.Text = "İşlevsiz"
Else
If f = 45 Then
txtgir.Text = "1"
Else
b = Tan(f * 3.1415 / 180)
txtgir.Text = ""
txtgir.Text = b
End If
End If
End If
Me.txtgir.SetFocus
End Sub
Private Sub cmdsil_Click()
a = txtgir.Text
If a <> "" Then
b = Len(a)
txtgir.Text = Left(txtgir.Text, b - 1)
Else
MsgBox "cmdsilinecek Sayı Yok"
End If
End Sub
Private Sub cmdyuvarla_Click()
f = txtgir.Text
b = Sqr(f)
txtgir.Text = ""
txtgir.Text = b
Me.txtgir.SetFocus
End Sub
Private Sub cmdmutlak_Click()
f = txtgir.Text
q = Abs(f)
txtgir.Text = q
Me.txtgir.SetFocus
End Sub
Private Sub cmdloga_Click()
f = txtgir.Text
u = Log(f) / Log(10)
txtgir.Text = u
Me.txtgir.SetFocus
End Sub
Private Sub cmddokuz_Click()
txtgir.Text = txtgir.Text & 9
Me.txtgir.SetFocus
End Sub

Private Sub cmddort_Click()
txtgir.Text = txtgir.Text & 4
Me.txtgir.SetFocus
End Sub
Private Sub cmdesitir_Click()
If txtgir.Text = "" Then
MsgBox ("İşlem Yapınız")
Else
c = txtgir.Text
If lblisaret.Caption = "+" Then txtgir.Text = b + c
If lblisaret.Caption = "-" Then txtgir.Text = b - c
If lblisaret.Caption = "*" Then txtgir.Text = b * c
If lblisaret.Caption = "/" Then txtgir.Text = b / c
Beep
End If
Me.txtgir.SetFocus
End Sub

Private Sub Form_Load()
mntarih.Caption = Date
mnnormal.Enabled = False
kilit2.Enabled = False
kilit3.Enabled = False
End Sub
Private Sub txtgir_Change()
kilit2.Enabled = True
kilit3.Enabled = True
If txtgir.Text = "" Then
kilit2.Enabled = False
kilit3.Enabled = False
End If
End Sub
Private Sub txtgir_KeyPress(KeyAscii As Integer)
If txtgir.Text = "" Then
txtgir.Text = ""
Else
If KeyAscii = 27 Then
txtgir.Text = ""
End If
If KeyAscii = 13 Then
cmdesitir_Click
End If
If KeyAscii = 43 Then
cmdtopla_Click
End If
If KeyAscii = 45 Then
cmdcıkar_Click
End If
If KeyAscii = 47 Then
cmdbol_Click
End If
If KeyAscii = 42 Then
cmdcarp_Click
End If
End If
If KeyAscii <> 8 Then
If Not IsNumeric(Chr(KeyAscii)) Then KeyAscii = 0
End If
End Sub
Private Sub cmdiki_Click()
txtgir.Text = txtgir.Text & 2
Me.txtgir.SetFocus
End Sub
Private Sub cmdkareal_Click()
b = txtgir.Text
txtgir.Text = b * b
Me.txtgir.SetFocus
End Sub
Private Sub cmdkdv_Click()
b = txtgir.Text
txtgir.Text = b * 0.18
txtgir.SetFocus
End Sub
Private Sub mnalan_Click()
frmhesap.Enabled = False
frmhesap.Visible = False
frmalan.Show
End Sub
Private Sub mncık_Click()
For i = 1 To 150
frmhesap.Width = frmhesap.Width - i
frmhesap.Height = frmhesap.Height - i
Next
End
End Sub
Private Sub mngelismis_Click()
a = 5
For i = a To 66
frmhesap.Width = frmhesap.Width + i
Next
mngelismis.Enabled = False
mnnormal.Enabled = True
End Sub
Private Sub mnkur_Click()
frmdoviz.Show
frmhesap.Enabled = False
frmhesap.Visible = False
End Sub
Private Sub mnnormal_Click()
a = 5
For i = a To 66
frmhesap.Width = frmhesap.Width - i
Next
mngelismis.Enabled = True
mnnormal.Enabled = False
End Sub
Private Sub cmdsekıs_Click()
txtgir.Text = txtgir.Text & 8
Me.txtgir.SetFocus
End Sub
Private Sub cmdsıfır_Click()
txtgir.Text = txtgir.Text & 0
Me.txtgir.SetFocus
End Sub
Private Sub cmdtemizle_Click()
txtgir.Text = ""
Me.txtgir.SetFocus
End Sub
Private Sub saat_Timer()
mngoster.Caption = Time
End Sub
Private Sub cmdtopla_Click()
b = txtgir.Text
txtgir.Text = ""
lblisaret.Caption = "+"
Me.txtgir.SetFocus
End Sub
Private Sub cmdüc_Click()
txtgir.Text = txtgir.Text & 3
Me.txtgir.SetFocus
End Sub
Private Sub cmdyedi_Click()
txtgir.Text = txtgir.Text & 7
Me.txtgir.SetFocus
End Sub

Virgüllü hesaplamalar
Private Sub Form_Load()
lstislemlerim.Enabled = False
kilit.Enabled = False
lstislemlerim.AddItem "Topla"
lstislemlerim.AddItem "Çarp"
lstislemlerim.AddItem "Çıkart"
lstislemlerim.AddItem "Böl"
End Sub
Private Sub Form_Unload(Cancel As Integer)
frmhesap.Enabled = True
frmhesap.Visible = True
End Sub
Private Sub lstislemlerim_Click()
txtsonuc.Visible = True
txtsonuc.Visible = True
a = lstislemlerim.ListIndex
If a = 0 Then
txtsonuc = CDbl(txtsayı1.Text) + CDbl(txtsayı2.Text)
End If
If a = 1 Then
txtsonuc = CDbl(txtsayı1.Text) * CDbl(txtsayı2.Text)
End If
If a = 2 Then
txtsonuc = CDbl(txtsayı1.Text) - CDbl(txtsayı2.Text)
End If
If a = 3 Then
txtsonuc = CDbl(txtsayı1.Text) / CDbl(txtsayı2.Text)
End If
End Sub


Private Sub txtsayı1_Change()

If txtsayı1.Text = "" Then
kilit.Enabled = False
Else
kilit.Enabled = True
End If
End Sub
Private Sub txtsayı1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 190 Then
MsgBox ("Nokta yerine (.) Virgül (,) kullanın")
End If
End Sub
Private Sub txtsayı1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
lstislemlerim.Selected(lstislemlerim.ListIndex) = False
End Sub
Private Sub txtsayı2_Change()
If txtsayı2.Text = "" Then
lstislemlerim.Enabled = False
Else
lstislemlerim.Enabled = True
End If
End Sub
Private Sub txtsayı2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 190 Then
MsgBox ("Nokta yerine (.) Virgül (,) kullanın")
End If
End Sub

Private Sub txtsayı2_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
lstislemlerim.Selected(lstislemlerim.ListIndex) = False
End Sub



Private Sub txtsonuc_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
lstislemlerim.Selected(lstislemlerim.ListIndex) = False
End Sub

Private Sub cmdtemizle_Click()
lstislemlerim.Selected(lstislemlerim.ListIndex) = False
txtsayı1.Text = ""
txtsayı2.Text = ""
txtsonuc.Text = ""
txtsayı1.SetFocus
End Sub
C@GL@R Çevrimdışı  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Stumble this Post!Google Bookmark this Post!
Alıntı ile Cevapla
Alt 12-07-2004, 02:23 PM   #2 (permalink)
Yeni Üye
 
Üyelik tarihi: Oct 2004
Mesajlar: 34
İtibar Gücü: 0 serseri is an unknown quantity at this point
hııım birinci sınıfta iken benzer çalışmalar yapmıştık eline saglık :nevet
__________________
sen ayrılık nedir bilir misin? ben bilirim ayrılık, sensizlik demektir. sen, sensizlik nedir bilir misin? ben bilirim sensizlik, çöllerde kutupları düşünmektir sen, kutup nedir bilir misin? ben bilirim meridyenlerin birleştiği yere kutup denir...
serseri Çevrimdışı  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Stumble this Post!Google Bookmark this Post!
Alıntı ile Cevapla
Alt 04-24-2005, 10:45 PM   #3 (permalink)
DM Sever
 
Üyelik tarihi: Apr 2005
Nerden: eskişehir
Mesajlar: 118
İtibar Gücü: 0 uzeyir_ipek is an unknown quantity at this point
kodlar için teşekkürler
uzeyir_ipek Çevrimdışı  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Stumble this Post!Google Bookmark this Post!
Alıntı ile Cevapla
Sponsor Linkler
Alt 12-20-2005, 01:22 AM   #4 (permalink)
Guest
 
Mesajlar: n/a
vb den hiç anlamıyorum.delphi daha güzel yahu..
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Stumble this Post!Google Bookmark this Post!
Alıntı ile Cevapla
Cevapla


Konuyu Toplam 1 Üye okuyor. (0 Kayıtlı üye ve 1 Misafir)
 
Seçenekler
Stil

Yetkileriniz
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is Açık
Smileler Açık
[IMG] Kodları Açık
HTML-KodlarıKapalı
Trackbacks are Açık
Pingbacks are Açık
Refbacks are Açık


Bütün Zaman Ayarları WEZ +4 olarak düzenlenmiştir. Şu Anki Saat: 05:54 AM .


Donanım forumu - oyun - gtaoyun hilelerioyun - voip  - eğlence - barbie oyunları
 

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0