12 Eylül 2013 Perşembe
Text Güncelleme Kodları
ÖRNEK KODLARI
İNDİR
Form Kodları :
Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load YaziAyarla(TextBox2, "Ad") YaziAyarla(TextBox3, "Soyad") End Sub Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click TextBox3.Text = Nothing End Sub Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click TextBox2.Text = Nothing End Sub End Class
Modül kodları
Imports System.Runtime.InteropServices Module GuncellenenText
_ Private Function SendMessage(ByVal hWnd As IntPtr, ByVal msg As Integer, ByVal wParam As Integer,
ByVal lParam As String) As Int32 End Function Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As IntPtr, ByVal hWnd2 As IntPtr, ByVal lpsz1 As String, ByVal lpsz2 As String) As IntPtr Private Const EM_SETCUEBANNER As Integer = &H1501 Public Sub YaziAyarla(ByVal control As Control, ByVal text As String) If TypeOf control Is ComboBox Then Dim Edit_hWnd As IntPtr = FindWindowEx(control.Handle, IntPtr.Zero, "Giriş yapınız", Nothing) If Not Edit_hWnd = IntPtr.Zero Then SendMessage(Edit_hWnd, EM_SETCUEBANNER, 0, text) End If ElseIf TypeOf control Is TextBox Then SendMessage(control.Handle, EM_SETCUEBANNER, 0, text) End If End Sub End Module
Sonraki Kayıt
Önceki Kayıt
Ana Sayfa