[GM] Essence

Öğretiyorum
Kayıt
23 Haziran 2009
Mesajlar
847
Beğeniler
0
Kayan Form Başlığı

'Forma Bir Adet Timer Yerleştirin.

Dim dene
Dim X
Dim z

Private Sub Form_Load()
dene = "kayan form başlığı"
X = 0
z = Len(dene)
Timer1.Interval = 100
End Sub

Private Sub Timer1_Timer()

'kayan form basligi
Dim dene1
110
z = z - 1
X = X + 1
dene1 = Right(dene, z) + " - " + Left(dene, X)
Caption = dene1
If z < 1 Then
z = Len(dene)
X = 0
GoTo 110
End If

End Sub

Rastgele bir sayı

'Aşağıdaki 25 sayısı en fazla ne kadar sallayacağını gösterir
'0 sayısınında dahil olmasını isterseniz + 1 i çıkartın.
Int(Rnd * 25) + 1

Güzel bir form çıkışı.

Private Sub Form_Unload(Cancel As Integer)
Do Until Form1.Top = Screen.Height
Form1.Top = Form1.Top + 1
Loop
Unload Me
End Sub

Titreyen Form.

'1 adet timer yerleştirin.
Private Sub Form_Load()
Timer1.Interval = 22
End Sub
Private Sub Timer1_Timer()
Form1.Top = Form1.Top + 50
Form1.Top = Form1.Top - 50
Form1.Left = Form1.Left - 50
Form1.Left = Form1.Top + 50
End Sub

Textte yazılanı form başlığı yap.

'Bir adet text box yerleştirin.
Private Sub Text1_Change()
Form1.Caption = Text1.Text
End Sub

Sağa sola hareket eden command buton.

'Form üzerine Timer ve Command yerleştiriniz.
'Timerin Intervalını istediğiniz değeri yazın.
Private Sub Timer1_Timer()
If Timer1.Tag = "sag" Then
Command1.Left = Command1.Left + 100
If Command1.Left >= Form1.Width Then
Timer1.Tag = "sol"
End If
Else
Command1.Left = Command1.Left - 100
If Command1.Left <= 0 Then
Timer1.Tag = "sag"
End If
End If
End Sub

Ekran çözünürlüğünü bulmak.

'Bir adet command button gerekmekte.
'Bir adet modul olusturun aşağıdaki kodları yazın.
'Modul başlangıcı.---
Option Explicit
Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Public Const SPI_GETWORKAREA& = 48
Public Declare Function SystemParametersInfo Lib "user32" Alias _
"SystemParametersInfoA" (ByVal uAction As Long, _
ByVal uParam As Long, lpvParam As Any, ByVal fuWinIni As Long) As Long


'Modul Sonu ----

'Form'a yazılacak Kodlar.

Private Sub Command1_Click()
Dim rct As RECT
Dim z As Long
Dim msg As String
z = SystemParametersInfo(SPI_GETWORKAREA, 0&, rct, 0&)
msg = "Ekran Çözünürlüğü" & vbCrLf
msg = msg & "Genişlik - " & rct.Right & vbCrLf
msg = msg & "Yükseklik - " & rct.Bottom & vbCrLf & vbCrLf
MsgBox msg
End Sub
'Form'a yazılacak Kodların Sonu.
 

[GM] Essence

Öğretiyorum
Kayıt
23 Haziran 2009
Mesajlar
847
Beğeniler
0

Int(Rnd * 25) - 1
değil
Int(Rnd * 25) + 1


Üzgünüm yanlış yazmışım :(
Düzelttim
 
Yukarı Alt