1. Form her zaman ustte(vb5)
VISUAL BASIC
" Bu vb5 icin gecerlidir. diğer form ustte vb6 icin gecerliydi. ..."
Hepsini Sec'Calışan programınızda yeni bir form acıldığında bunun en 'ustte gorunmesi icin; orn 2 form oluşturun form1_load 'a
'form2.Show ,me
'yazın.
'Bu yontem yalnızca programınızdaki formlar icin gecerlidir. Diğer bir program calıştığında bunun uzerini ortebilir.
'Tum uygulamaların uzerinde kalan bir form
'oluşturmak icin; declare kısmına
Private Declare Function SetWindowPos Lib "user32"
(ByVal hwnd As Long, _
ByVal hWndInsertAfter As Long, ByVal x As Long,
ByVal y As Long, _
ByVal cx As Long, ByVal cy As Long,
ByVal wFlags As Long) As Long
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOSIZE = &H1
Private Const HWND_TOPMOST = -1
Private Const HWND_NOTOPMOST = -2
En ustte kalmasını istediğinizde:
SetWindowPos hwnd, _
HWND_TOPMOST, 0, 0, 0, 0, _
SWP_NOMOVE + SWP_NOSIZE
Bu ozelliği geri almak icin:
SetWindowPos hwnd, _
HWND_NOTOPMOST, 0, 0, 0, 0, _
SWP_NOMOVE + SWP_NOSIZE
2. İp numaranı gor
VISUAL BASIC
" Winsock nesnesi ile ip numaranı gor ..."
Hepsini Seconcelikle Project>Components yolunu izleyerek acılan pencerenin Controls bolumunden Microsoft Winsock Controls 6.0 (SP6) yi arac kutusuna ekleyin
Forma buton ve winsock nesnesini ekleyin.
Aşağıdaki kodları yazın
Private Sub Command1_Click()
ip = Winsock1.LocalIP
MsgBox ip
End Sub
3. 3 yazılı ve 3 sozlu notu girilerek ortalama hesabı yapar ..."
Hepsini SecDim kontrol As Integer
Private Sub Command1_Click()
If Text1.Text < 0 Or Text1.Text > 100 Then
MsgBox "yanlış"
ElseIf Text2.Text < 0 Or Text2.Text > 100 Then
MsgBox "yanlış"
ElseIf Text3.Text < 0 Or Text3.Text > 100 Then
MsgBox "yanlış"
ElseIf Text4.Text < 0 Or Text4.Text > 100 Then
MsgBox "yanlış"
ElseIf Text5.Text < 0 Or Text5.Text > 100 Then
MsgBox "yanlış"
ElseIf Text6.Text < 0 Or Text6.Text > 100 Then
MsgBox "yanlış"
End If
Text7.Text = (Val(Text1.Text) + Val(Text2.Text) + Val(Text3.Text)) / 3
Text8.Text = (Val(Text4.Text) + Val(Text5.Text) + Val(Text6.Text)) / 3
Text9.Text = (Val(Text7.Text) + Val(Text8.Text)) / 2
Select Case Text9.Text
Case 0 To 44
Text10.Text = "CAKTI"
Case Else
Text10.Text = "YIRTTI"
End Select
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text1.SetFocus
End Sub
Private Sub Command3_Click()
kontrol = MsgBox("CIKMAK İSTEDİĞİNİZE EMİN MİSİNİZ?", vbQuestion + vbYesNo, "Cıkış Formu")
Select Case Control
Case vbYes
End
End Select
End Sub
__________________
vb de en cok kullanılan kodlar...
Programlama0 Mesaj
●42 Görüntüleme
- ReadBull.net
- Programlama ve Yazılım
- Programlama
- vb de en cok kullanılan kodlar...