20-03-13, 01:15 PM
كود :
Dim gh As New Label
Dim newtext As New TextBox
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
For Each c As Control In Me.Controls
If TypeOf c Is TextBox Then
If c.Name = "TextBox1" Then
Dim color1 As New Color
color1 = c.BackColor
Dim color2 As New Color
color2 = c.ForeColor
Dim size1 As New Size
size1 = c.Size
Dim size2 As New Size
size2 = c.Location
'\\\\\\\\\\\\\\\\\\\
gh.Text = "بحث"
gh.ForeColor = Color.Red
gh.BackColor = c.BackColor
gh.Location = c.Location
gh.Size = c.Size
Me.Controls.Add(gh)
AddHandler gh.MouseEnter, AddressOf gh_mouseenter
'\\\\\\\\\\\\\\\\\\\\
Me.Controls.Remove(c)
newtext.BackColor = color1
newtext.ForeColor = color2
newtext.Size = size1
newtext.Location = size2
Me.Controls.Add(newtext)
AddHandler newtext.MouseLeave, AddressOf newtext_mouseLeave
Exit For
End If
End If
Next
End Sub
Private Sub newtext_mouseLeave(ByVal sender As Object, ByVal e As System.EventArgs)
If newtext.Text = Nothing Then
gh.Visible = True
End If
End Sub
Private Sub gh_mouseenter(ByVal sender As Object, ByVal e As System.EventArgs)
gh.Visible = False
End Sub