Arşiv

Archive for Ekim, 2006

windows bilgileriniz

18 Oct 2006 karaltan Yorum yapın

Bu kod ile pencerelerin büyüklügünden farenizde kaç tus olduguna, windows’un hangi kipte çalistigina kadar herseyini görebilirsiniz. Bunun için bir listbox çizmeniz ve asagidaki kodlari yazmaniz yeterli olacaktir.

Private Declare Function GetSystemMetrics Lib “user32″ (ByVal nIndex As Long) As Long

Private Sub Command1_Click()
frmAbout.Show
End Sub

Private Sub Command2_Click()
End
End Sub

Sub Form_Load()
List1.AddItem ” WINDOWS HAKKINDA BAZI BILGILER…”
List1.AddItem “”

List1.AddItem “0 Ekranin yatay genisligi=” & GetSystemMetrics(0)
List1.AddItem “1 Ekranin dikey genisiligi=” & GetSystemMetrics(1)
List1.AddItem “2 Dikey kaydirma çubugundaki okun boyutu=” & GetSystemMetrics(2)
List1.AddItem “3 Yatay kaydirma çubugundaki okun boyutu=” & GetSystemMetrics(3)
List1.AddItem “4 Pencere basliginin Yüksekligi=” & GetSystemMetrics(4)
List1.AddItem “5 Boyutlandirilmayan pencerelerin yatay kenarlik kalinligi=” & GetSystemMetrics(5)
List1.AddItem “6 Boyutlandirilmayan pencerelerin dikey kenarlik kalinligi=” & GetSystemMetrics(6)
List1.AddItem “7 Dialog kutularinin yatay kenarlik kalinligi=” & GetSystemMetrics(7)
List1.AddItem “8 Dialog kutularinin dikey kenarlik kalinligi=” & GetSystemMetrics(8)
List1.AddItem “9 Yatay kaydirma çubuklarindaki kaydirma kutusunun yüksekligi=” & GetSystemMetrics(9)
List1.AddItem “10 Yatay kaydirma çubuklarindaki kaydirma kutusunun genisligi=” & GetSystemMetrics(10)
List1.AddItem “11 Standart ikon genisligi=” & GetSystemMetrics(11)
List1.AddItem “12 Standart ikon yüksekligi=” & GetSystemMetrics(12)
List1.AddItem “13 Standart kursor genisligi=” & GetSystemMetrics(13)
List1.AddItem “14 Standart kursor yüksekligi=” & GetSystemMetrics(14)
List1.AddItem “15 Menü yüksekligi=” & GetSystemMetrics(15)
List1.AddItem “16 Ekrani kaplamis durumdaki menünün iç genisligi=” & GetSystemMetrics(16)
List1.AddItem “17 Ekrani kaplamis durumdaki menünün iç yülsekligi=” & GetSystemMetrics(17)
If GetSystemMetrics(19) Then
List1.AddItem “18 Bilgisayara bagli bir fare var”
Else
List1.AddItem “18 Bilgisayara bagli bir fare yok”
End If
List1.AddItem “19 Dikey kaydirma çubugundaki okun yüksekligi=” & GetSystemMetrics(20)
List1.AddItem “20 Dikey kaydirma çubugundaki okun genisligi=” & GetSystemMetrics(21)

If GetSystemMetrics(22) Then
List1.AddItem “21 Windows debug modunda çalisiyor”
Else
List1.AddItem “21 Windows debug modunda çalismiyor”
End If
If GetSystemMetrics(23) Then
List1.AddItem “23 Fare dügmeleri yer degistirilmis”
Else
List1.AddItem “23 Fare dügmeleri yer degistirilmemis”
End If
List1.AddItem “24 Pencerenin alabilecek minimum genisligi=” & GetSystemMetrics(28)
List1.AddItem “25 Pencerenin alabilecek minimum yüksekligi=” & GetSystemMetrics(29)
List1.AddItem “26 Baslik çubugundaki resmin genisligi=” & GetSystemMetrics(30)
List1.AddItem “27 Baslik çubugundaki resmin yüksekligi=” & GetSystemMetrics(31)
List1.AddItem “28 Çift tiklama için farenin yatay sapma genisligi=” & GetSystemMetrics(36)
List1.AddItem “29 Çift tiklama için farenin yatay sapma yüksekligi=” & GetSystemMetrics(37)
List1.AddItem “30 Masaüstü ikonlarinin genisligi=” & GetSystemMetrics(38)
List1.AddItem “31 Masaüstü ikonlarinin yüksekligi=” & GetSystemMetrics(39)

If GetSystemMetrics(40) Then
List1.AddItem “32 Popup menüleri sag tarafa dogru açiliyor”
Else
List1.AddItem “32 Popup menüleri sag tarafa dogru açilmiyor”
End If
If GetSystemMetrics(41) Then
List1.AddItem “33 Kalem yüklenmis onun handle numarasi==” & GetSystemMetrics(41)
Else
List1.AddItem “33 Kalem yüklenmemis”
End If
If GetSystemMetrics(42) Then
List1.AddItem “34 Window karakterler için iki byte (Japonca gibi) kullaniyor”
Else
List1.AddItem “34 Window karakterler için iki byte (Japonca gibi) kullanmiyor”
End If
List1.AddItem “35 Farede bulunan dügme sayisi” & GetSystemMetrics(43)
List1.AddItem “36 Basliklarin genisligi=” & GetSystemMetrics(51)
List1.AddItem “37 Ekrani kaplamis durumdaki pencerenin yüksekligi” & GetSystemMetrics(61)

If GetSystemMetrics(63) Then
List1.AddItem “38 Yüklü bir ag var”
Else
List1.AddItem “38 Yüklü bir ag yok”
End If
Select Case GetSystemMetrics(67)
Case 0: List1.AddItem “39 Windows açilis modu. Normal”
Case 1: List1.AddItem “39 Windows açilis modu. Güvenli kip”
Case 2: List1.AddItem “39 Windows açilis modu. Ag destegiyle Güvenli kip”
End Select

List1.AddItem “40 Menülerdeki check isaretinin genisligi=” & GetSystemMetrics(71)
List1.AddItem “41 Menülerdeki check isaretinin yüksekligi=” & GetSystemMetrics(72)

If GetSystemMetrics(73) Then
List1.AddItem “42 Bilgisayariniz çok yavas”
Else
List1.AddItem “42 Bilgisayariniz çok yavas degil”
End If
If GetSystemMetrics(74) Then
List1.AddItem “43 Arapça Windows var”
Else
List1.AddItem “43 Arapça Windows yok”
End If
End Sub

Categories: VB6 kodları

automatic capitalize each word

18 Oct 2006 karaltan Yorum yapın

‘****************
‘Tony Southwood
‘Seagoing Software
‘tony@seagoing.freeserve.co.uk
‘Date 9 Jan 99

‘Purpose:
‘Automatically capitalise the first letter of each word
‘in a text box as you type. Being inherently lazy, I have
‘found this particularly useful entering address info…
‘****************

‘****************
‘In the keypress event of the textbox
‘control that autotype is to apply to
‘enter the following line of code….
‘****************
Private Sub YourTextBoxControl_KeyPress(KeyAscii As Integer)
KeyAscii = AutoType(Screen.ActiveControl, KeyAscii)
End Sub

‘****************
‘In a suitable module create the Public Funtion as listed below
‘****************
Public Function AutoType(c As Control, KeyAscii As Integer) As Integer
AutoType = KeyAscii
If KeyAscii > 95 And KeyAscii <123 Then If c.SelStart=”0″ Then AutoType=”AutoType” 32 ElseIf Mid$(c.Text, c.SelStart, 1) < “!” Then AutoType=”AutoType” 32 End If End If End Function

Categories: VB6 kodları

sayısal loto

18 Oct 2006 karaltan Yorum yapın

‘Güzel bir numara sallama örneği; önce üç tane commmand buton koy sonra ‘6 Text box ve kodu kopyala

Private Sub Command1_Click()
Dim NumberList(5) As Integer
‘ Numaraların her zaman farklı olması için bunu yazıyoruz
Randomize Timer
Text1.Text = Int(Rnd * 49) + 1
Text2.Text = Int(Rnd * 49) + 1
Text3.Text = Int(Rnd * 49) + 1
Text4.Text = Int(Rnd * 49) + 1
Text5.Text = Int(Rnd * 49) + 1
Text6.Text = Int(Rnd * 49) + 1
‘Sallanan numaraların aynı olma ihtimali çok yüksektir bundan dolyı bu kodları ekliyoruz
If Text1.Text = Text2.Text Or Text1.Text = Text3.Text Or Text1.Text = Text4.Text Or Text1.Text = Text5.Text Or Text1.Text = Text6.Text Then
Text1.Text = Int(Rnd * 49) + 1
End If
If Text2.Text = Text1.Text Or Text2.Text = Text3.Text Or Text2.Text = Text4.Text Or Text2.Text = Text5.Text Or Text2.Text = Text6.Text Then
Text2.Text = Int(Rnd * 49) + 1
End If
If Text3.Text = Text1.Text Or Text3.Text = Text2.Text Or Text3.Text = Text4.Text Or Text3.Text = Text5.Text Or Text3.Text = Text6.Text Then
Text3.Text = Int(Rnd * 49) + 1
End If
If Text4.Text = Text1.Text Or Text4.Text = Text2.Text Or Text4.Text = Text3.Text Or Text4.Text = Text5.Text Or Text4.Text = Text6.Text Then
Text4.Text = Int(Rnd * 49) + 1
End If
If Text5.Text = Text1.Text Or Text5.Text = Text2.Text Or Text5.Text = Text3.Text Or Text5.Text = Text4.Text Or Text5.Text = Text6.Text Then
Text5.Text = Int(Rnd * 49) + 1
End If
If Text6.Text = Text1.Text Or Text6.Text = Text2.Text Or Text6.Text = Text3.Text Or Text6.Text = Text4.Text Or Text6.Text = Text5.Text Then
Text6.Text = Int(Rnd * 49) + 1
End If
‘Bu kodlar text boxlardaki değerlerin küçükten büyüğe sıralanmasını sağlar
NumberList(0) = CInt(Text1.Text)
NumberList(1) = CInt(Text2.Text)
NumberList(2) = CInt(Text3.Text)
NumberList(3) = CInt(Text4.Text)
NumberList(4) = CInt(Text5.Text)
NumberList(5) = CInt(Text6.Text)
For j = 0 To 5
For i = 0 To 4
If NumberList(i) > NumberList(i + 1) Then
temp = NumberList(i)
NumberList(i) = NumberList(i + 1)
NumberList(i + 1) = temp
End If
Next i
Next j
Text1.Text = NumberList(0)
Text2.Text = NumberList(1)
Text3.Text = NumberList(2)
Text4.Text = NumberList(3)
Text5.Text = NumberList(4)
Text6.Text = NumberList(5)
End Sub

Private Sub Command2_Click()
mesaj = MsgBox(“Bu Program Şükrü Sanioğlu tarafından yapılmıştır (C). 2003-2004 | SS-Yazılım |”, 10, “Sayısal Loto 6/49 Programı Hakkında”)
End Sub

Private Sub Command3_Click()
End
End Sub

Categories: VB6 kodları

10 numara

18 Oct 2006 karaltan Yorum yapın

Private Declare Function CreateEllipticRgn Lib “gdi32″ (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Declare Function SetWindowRgn Lib “user32″ (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Long) As Long
Private Sub Command3_Click()
mesaj = MsgBox(“GüleGüle……İyi Şanslar……”, 10, “Program Kapanıyor…”)
ActiveWorkbook.Save
Excel.Application.Quit
End
End Sub
Private Sub Command4_Click()
Dim Numaralar As String
Numaralar = (Text1.Text & ” – ” & Text2.Text & ” – ” & Text3.Text & ” – ” & Text4.Text & ” – ” & Text5.Text & ” – ” & Text6.Text & ” – ” & Text7.Text & ” – ” & Text8.Text & ” – ” & Text9.Text & ” – ” & Text10.Text & ” “)
List1.AddItem Numaralar, List1.ListCount
End Sub
Private Sub Command5_Click()
If List1.ListCount >= 1 Then
If List1.ListIndex = -1 Then
List1.ListIndex = _
List1.ListCount – 1
End If
List1.RemoveItem (List1.ListIndex)
End If
End Sub
Private Sub Command6_Click()
List1.Clear
End Sub
Private Sub Command7_Click()
Text11.Text = List1.ListCount & ” tane kolon oynandı”
End Sub
Private Sub Command8_Click()
For i = 0 To List1.ListCount – 1
If List1.Selected(i) Then
List1.Selected(i) = WorksheetFunction.Count(Range(“A1:A65000″)) + 1
Do While Not IsEmpty(ActiveCell)
ActiveCell.Offset(1, 0).Select
Loop
ActiveCell.Value = List1.List(i)
End If
Next
End Sub
Private Sub Command1_Click()
Dim NumberList(9) As Integer
Dim Numaralar As String
Randomize Timer
Text1.Text = Int(Rnd * 80) + 1
Text2.Text = Int(Rnd * 80) + 1
Text3.Text = Int(Rnd * 80) + 1
Text4.Text = Int(Rnd * 80) + 1
Text5.Text = Int(Rnd * 80) + 1
Text6.Text = Int(Rnd * 80) + 1
Text7.Text = Int(Rnd * 80) + 1
Text8.Text = Int(Rnd * 80) + 1
Text9.Text = Int(Rnd * 80) + 1
Text10.Text = Int(Rnd * 80) + 1
‘Aşağıdaki kod numaraları sıralar
NumberList(0) = CInt(Text1.Text)
NumberList(1) = CInt(Text2.Text)
NumberList(2) = CInt(Text3.Text)
NumberList(3) = CInt(Text4.Text)
NumberList(4) = CInt(Text5.Text)
NumberList(5) = CInt(Text6.Text)
NumberList(6) = CInt(Text7.Text)
NumberList(7) = CInt(Text8.Text)
NumberList(8) = CInt(Text9.Text)
NumberList(9) = CInt(Text10.Text)
For j = 0 To 9
For i = 0 To 8
If NumberList(i) > NumberList(i + 1) Then
temp = NumberList(i)
NumberList(i) = NumberList(i + 1)
NumberList(i + 1) = temp
End If
Next i
Next j
Text1.Text = NumberList(0)
Text2.Text = NumberList(1)
Text3.Text = NumberList(2)
Text4.Text = NumberList(3)
Text5.Text = NumberList(4)
Text6.Text = NumberList(5)
Text7.Text = NumberList(6)
Text8.Text = NumberList(7)
Text9.Text = NumberList(8)
Text10.Text = NumberList(9)

Numaralar = (Text1.Text & ” – ” & Text2.Text & ” – ” & Text3.Text & ” – ” & Text4.Text & ” – ” & Text5.Text & ” – ” & Text6.Text & ” – ” & Text7.Text & ” – ” & Text8.Text & ” – ” & Text9.Text & ” – ” & Text10.Text & ” “)
List1.AddItem Numaralar, List1.ListCount
End Sub
Private Sub Command2_Click()
mesaj = MsgBox(“Bu Program Şükrü Sanioğlu tarafından yapılmıştır (C). 2003-2004 | |”, 10, “On Numara Programı Hakkında”)
End Sub
Private Sub Form_Load()
Set uygulama = CreateObject(“Excel.application”)
‘Burada ben c:\kolonlar olarak açtım sizz farklı bir isimde farklı bir yere aça bilirsiniz
uygulama.Workbooks.Open (“c:\kolonlar.xls”)
‘Eğer visible demezseniz dosya gözükmez
uygulama.Visible = True

End Sub

Private Sub Text1_Change()
If Text1.Text = Text2.Text Or Text1.Text = Text3.Text Or Text1.Text = Text4.Text Or Text1.Text = Text5.Text Or Text1.Text = Text6.Text Or Text1.Text = Text7.Text Or Text1.Text = Text8.Text Or Text1.Text = Text9.Text Or Text1.Text = Text10.Text Then
Text1.Text = Int(Rnd * 80) + 1
End If
End Sub

Private Sub Text2_Change()
If Text2.Text = Text1.Text Or Text2.Text = Text3.Text Or Text2.Text = Text4.Text Or Text2.Text = Text5.Text Or Text2.Text = Text6.Text Or Text2.Text = Text7.Text Or Text2.Text = Text8.Text Or Text2.Text = Text9.Text Or Text2.Text = Text10.Text Then
Text2.Text = Int(Rnd * 80) + 1
End If
End Sub

Private Sub Text3_Change()
If Text3.Text = Text1.Text Or Text3.Text = Text2.Text Or Text3.Text = Text4.Text Or Text3.Text = Text5.Text Or Text3.Text = Text6.Text Or Text3.Text = Text7.Text Or Text3.Text = Text8.Text Or Text3.Text = Text9.Text Or Text3.Text = Text10.Text Then
Text3.Text = Int(Rnd * 80) + 1
End If
End Sub

Private Sub Text4_Change()
If Text4.Text = Text1.Text Or Text4.Text = Text2.Text Or Text4.Text = Text3.Text Or Text4.Text = Text5.Text Or Text4.Text = Text6.Text Or Text4.Text = Text7.Text Or Text4.Text = Text8.Text Or Text4.Text = Text9.Text Or Text4.Text = Text10.Text Then
Text4.Text = Int(Rnd * 80) + 1
End If
End Sub

Private Sub Text5_Change()
If Text5.Text = Text1.Text Or Text5.Text = Text2.Text Or Text5.Text = Text3.Text Or Text5.Text = Text4.Text Or Text5.Text = Text6.Text Or Text5.Text = Text7.Text Or Text5.Text = Text8.Text Or Text5.Text = Text9.Text Or Text5.Text = Text10.Text Then
Text5.Text = Int(Rnd * 80) + 1
End If
End If
End Sub
Private Sub Text6_Change()
If Text6.Text = Text1.Text Or Text6.Text = Text2.Text Or Text6.Text = Text3.Text Or Text6.Text = Text4.Text Or Text6.Text = Text5.Text Or Text6.Text = Text7.Text Or Text6.Text = Text8.Text Or Text6.Text = Text9.Text Or Text6.Text = Text10.Text Then
Text6.Text = Int(Rnd * 80) + 1
End If
End Sub
Private Sub Text7_Change()
If Text7.Text = Text1.Text Or Text7.Text = Text2.Text Or Text7.Text = Text3.Text Or Text7.Text = Text4.Text Or Text7.Text = Text5.Text Or Text7.Text = Text6.Text Or Text7.Text = Text8.Text Or Text7.Text = Text9.Text Or Text7.Text = Text10.Text Then
Text7.Text = Int(Rnd * 80) + 1
End If
End Sub

Private Sub Text8_Change()
If Text8.Text = Text1.Text Or Text8.Text = Text2.Text Or Text8.Text = Text3.Text Or Text8.Text = Text4.Text Or Text8.Text = Text5.Text Or Text8.Text = Text6.Text Or Text8.Text = Text7.Text Or Text8.Text = Text9.Text Or Text8.Text = Text10.Text Then
Text8.Text = Int(Rnd * 80) + 1
End If
End Sub

Private Sub Text9_Change()
If Text9.Text = Text1.Text Or Text9.Text = Text2.Text Or Text9.Text = Text3.Text Or Text9.Text = Text4.Text Or Text9.Text = Text5.Text Or Text9.Text = Text6.Text Or Text9.Text = Text7.Text Or Text9.Text = Text8.Text Or Text9.Text = Text10.Text Then
Text9.Text = Int(Rnd * 80) + 1
End If
End Sub
Private Sub Text10_Change()
If Text10.Text = Text1.Text Or Text10.Text = Text2.Text Or Text10.Text = Text3.Text Or Text10.Text = Text4.Text Or Text10.Text = Text5.Text Or Text10.Text = Text6.Text Or Text10.Text = Text7.Text Or Text10.Text = Text8.Text Or Text10.Text = Text9.Text Then
Text10.Text = Int(Rnd * 80) + 1
End If
End Sub

Categories: VB6 kodları

tüm textler boşalsın

18 Oct 2006 karaltan Yorum yapın

Dim Control

For Each Control In Form1.Controls
If TypeOf Control Is TextBox Then Control.Text = “”
Next

Categories: VB6 kodları

Tüm Kontrolleri Olanaksız Yapmak

18 Oct 2006 karaltan Yorum yapın

Dim i As Integer For i = 0 To Form1.Controls.Count – 1

‘Tüm Kontrolleri seç

Form1.Controls(i).Enabled = False Tüm kontrolleri olanaksız hale getir

Next

Categories: VB6 kodları

sadece sayı yaz

18 Oct 2006 karaltan Yorum yapın

Sub Text1_KeyPress (KeyAscii As Integer)
Dim N$
N = “0123456789.”
If KeyAscii <> 8 Then
If InStr(N, Chr(KeyAscii)) = 0 Then
Beep
KeyAscii = 0
Exit Sub
End If
End If
End Sub

Categories: VB6 kodları