Arşiv

Archive for the ‘VB6 kodları’ Category

VB.NET-VB Değişken Tanımlama Farklılıkları

13 Oct 2009 karaltan Yorum yapın

alıntı: http://www.evcil.net/post/vbnet-vb-temel-farkliliklar-1

Önkoşul : Bu konuyu daha iyi anlayabilmeniz için VB6da değişken tanımlama konusunu bilmeniz gerekmektedir.

Web Formları ve Windows Formları geliştirmek için, .NET de bir çok programlama dili kullanabiliriz. Bunlardan VB.NET en yaygın olarak kullanılan dildir.

 .NET ile birlikte, ASP.NET ile geliştirilen web uygulamaları artık herhangi bir scripting dili değil, doğrudan programlama dilinin kendisidir. Dolayısı ile etkin bir web uygulaması geliştirmek için ASP.NET”i iyi kullanabilmemizin yanısıra .NET’te tanımlı herhangi bir programlama diline hakim olmamız gereklidir. Yukarıda da belirttiğim gibi bu programlama dillerinden en yaygın olarak kullanılanı VB.NET dir.

 Halihazırda VB kullanan programcılar için VB.NET geçiş yapmak çok zor değildir. Çünkü bildirimler ve program geliştirme mantığı VB”ye çok benzemektedir. Yani geriye uyumluluk söz konusudur. Ancak VB.NET ile birlikte bildirim veya ifadeler açısından oldukça farklı değişimler de söz konusu olmuştur.

 Bu makalede bu VB6 ve VB.NET ifadeleri arasındaki temel değişim ve farklılıkları anlatmaya çalışacağım. VB ve VB.NET in çalışma alt yapısı tamamıyla farklıdır. Bu ayrı bir yazı konusudur. Ancak uygulama geliştiricler olarak bizi en çok ilgilendiren kısmı, uygulamayı geliştirirken uymamız gereken yazım kurallarıdır.

 Şimdi, lafı uzatmadan VB6 ve VB.NET deki temel ifade değişikliklerine ve farklılıklarına bir bakalım.

 Değişken Deklarasyonu değişikliği:

Öncelikle VB.NET de değişkenlerin deklare edilmesi zorunludur. Deklare edilmemiş herhangi bir değişkeni kullanmamız mümkün değildir. VB6 da bir değişken tanımlaması ve değer ataması minimum iki farklı satır gerektiriyordu:

            Dim a As Integer

            a=5

 Ancak VB.NET de tek satırda hem değişken tanımlaması hem de değer ataması yapmak mümkündür:

            Dim a As Integer = 5

 Diğer dikkate değer bir değişiklikte ise, VB.NET de aynı satır da birden fazla değişken tipini tanımlamak mümkün olmasıdır:

            Dim a, b As Integer

 Buradaki a ve b değişkenlerin her ikisininde değişken tipi, VB.NET de, Integer olarak kabul görür. Oysa VB6 da b Integer olabilir fakat a variant da olabilir.

 Yeni Atama biçimleri

VB.NET değişken değeri atamalarında yeni biçimleri veya ifadeleri destekler. Örneğin VB6 ve VB.NET de bir değişken değerini şöyle atayabiliriz: a = a + 7

Farklı olarak VB.NET de bunu kısa bir yoldan yapmamız mümkün:

            a +=7

Yukarıdaki iki ifade de VB.NET için aynı işi görür. Aynı şekilde şu ifadeleride kullanmak mümkün:

            a = a / 7 yerine            a /= 7

            a = a – 7 yerine             a -= 7

            a = a * 7 yerine             a *= 7

            a = a +7 yerine              a+ = 7

            a = a ^ 7 yerine             a ^= 7

 Bu ifadeler C/C++ dilindeki ifadelere benziyor. Ancak ++ operatörünü VB.NET desteklenmez.

 Dizi Değişkenler:

Diziler programlamada en çok hata yapılan konulardan biridir. Kafa karıştırıcı etkenlerin başında dizi boyutu ile eleman sayılarının farklılaşması vardır.

 VB6”da dizi indeksi sıfırdan başlıyabileceği gibi herhangi bir sayıdanda başlar. Ayrıca dizinin son elemanı, dizi indeksinde belirtilen değere eşittir, dolayısı ile eleman sayısı, dizi boyutunda belirtilenden, her zaman bir fazladır. Eğer alt limit sıfırdan başlamamışsa dahada değişiktir:

            Dim a(2) Integer

 a(0)=1

a(1)=1

a(2)=1

 Yukarıdaki örnekte dizi boyutu 2 olarak tanımlanmıştır, ancak herhangi bir şey belirtilmediğinden alt indeks sıfır değeri alır. Buna göre dizideki son elemenın indeks değeri 2, fakat dizideki değer sayısı yani eleman sayısı 3 tür. Oysa VB.NET dizi tanımları basitleştirilmiş ve kesin kurallar konmuştur. Bunlardan bir tanesi; dizi indeksleri daima sıfır (0) ile başlar. Dizideki eleman sayısı dizi boyutunda belirtilen değerle aynıdır. Buna göre dizinin üst sınır indeksi daima belirtilen boyuttan bir eksik değer alır. Yukarıdaki örneğimize dönecek olursak VB.NET bu dizi tanımlaması aşağıdaki gibi yapılır:

            Dim a(2) Integer

 a(0)=1

a(1)=2

 Yani dizi tanımlamasında parantez içindeki değer dizinin boyutunu belirtir ve dizi içindeki değişken sayısı bu boyuta eşittir. Ancak indeks değerleri, dizi sıfırdan başladığı için bunun bir eksiğidir.

 VB6 da ;

            Dim a (1 To 3) As Integer

 şeklinde dizinin alt indeksinin sıfırdan farklı olabileceğini belirten bir ifade kullanabilirdik. Böylece dizi sıfırda değil 1 den başlardı. VB.NET böyle bir ifade kullanımı kesinlikle yoktur. Diziler her zaman sıfır (0) dan başlar.

VB.NET de tek bir satırda dizi değişken değeri atamak mümkündür, ancak bunun da temel bir yazım ifadesi vardır:

            Dim renkler(3) As String = {“mavi” , “kırmızı”, “sarı”}

Burada değerleri {} belirteçleri içinde kullanmalıyız. Böyle bir kullanımda dizinin boyutunu kullanma zorunluluğu yoktur:

            Dim renkler() As String = {“mavi” , “kırmızı”, “sarı”}

Belirtilmemesine rağmen, alınan değerlerden dolayı, dizi boyutu 3 tür ve alt sınır indeksi, yukarıda da belirttiğim gibi daima sıfırdır. Bu örneğe göre “sarı” değerini veren dizi ifadesi renkler(2) dir.

alıntı: http://www.evcil.net/post/vbnet-vb-temel-farkliliklar-1

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ı