AccessTr.neT
Vbde tuşlara basarak buttonun boyutunu değiştiren program ? - Baskı Önizleme

+- AccessTr.neT (https://accesstr.net)
+-- Forum: Visual Basic 6 (https://accesstr.net/forum-visual-basic-6.html)
+--- Forum: Visual Basic 6 Cevaplanmış Soruları (https://accesstr.net/forum-visual-basic-6-cevaplanmis-sorulari.html)
+--- Konu Başlığı: Vbde tuşlara basarak buttonun boyutunu değiştiren program ? (/konu-vbde-tuslara-basarak-buttonun-boyutunu-degistiren-program.html)



Vbde tuşlara basarak buttonun boyutunu değiştiren program ? - Şeyma462 - 09/12/2010

Alt tuşuyla birlikte yön tuşlarına basıldığında formdaki buttonun boyutu değişen,
Ctrl tuşuyla yön tuşlarına basıldığında formdaki bileşenleri hareket ettiren,
F2 tuşuna basılınca formun adı o anki saat olan programın kodunu nasıl yazmalıyım?
Icon_rolleyes


Cvp: Vbde tuşlara basarak buttonun boyutunu değiştiren program ? - Coskun0559 - 13/12/2010

'butona 1 adet buton ekle ve kodları yapıştır.
Private Sub Command1_KeyDown(KeyCode As Integer, Shift As Integer)
'(buradaki kodlar alt tuşu ile birlikte yön tuşlarına basarsan
' butonunu sağa sola hareket ettirir)
If KeyCode = vbKeyRight And Shift = 4 Then
Command1.Width = Command1.Width + 50 'alt tuşu ile sağ yön tuşu butonu sağa doğru büyütür
End If
If KeyCode = vbKeyLeft And Shift = 4 Then
Command1.Width = Command1.Width - 50 'alt tuşu ile sağ yön tuşu butonu sola doğru küçültür
End If
If KeyCode = vbKeyUp And Shift = 4 Then
Command1.Width = Command1.Height + 500
End If
If KeyCode = vbKeyDown And Shift = 4 Then
Command1.Width = Command1.Height - 500
End If
' şimdi ctrl tuşlarıyla butonu hareket ettirelim ctrl tuşu ile yön tuşlarına bas
If KeyCode = vbKeyRight And Shift = 2 Then
Command1.Left = Command1.Left + 500
End If
If KeyCode = vbKeyLeft And Shift = 2 Then
Command1.Left = Command1.Left - 500
End If
If KeyCode = vbKeyUp And Shift = 2 Then
Command1.Top = Command1.Top - 500
End If
If KeyCode = vbKeyDown And Shift = 2 Then
Command1.Top = Command1.Top + 500
End If
'bu kodda formun başlığını saat yapar
If KeyCode = vbKeyF2 Then
Form1.Caption = Time
End If
'bu kodda formun başlığını tarih yapar
If KeyCode = vbKeyF3 Then
Form1.Caption = Date
End If
End Sub



Cvp: Vbde tuşlara basarak buttonun boyutunu değiştiren program ? - Şeyma462 - 18/12/2010

Çok Teşekkür ederim. Img-grin