|
Public Class frmMain
Inherits System.Windows.Forms.Form
#Region " Vom Windows Form Designer generierter Code "
Public Sub New()
MyBase.New()
InitializeComponent()
AddHandler TextBox1.MouseLeave, AddressOf myLeave
AddHandler TextBox2.MouseLeave, AddressOf myLeave
AddHandler TextBox3.MouseLeave, AddressOf myLeave
AddHandler TextBox4.MouseLeave, AddressOf myLeave
AddHandler RadioButton1.MouseLeave, AddressOf myLeave
AddHandler RadioButton2.MouseLeave, AddressOf myLeave
AddHandler RadioButton3.MouseLeave, AddressOf myLeave
AddHandler RadioButton4.MouseLeave, AddressOf myLeave
AddHandler Label1.MouseLeave, AddressOf myLeave
AddHandler Label2.MouseLeave, AddressOf myLeave
AddHandler Label3.MouseLeave, AddressOf myLeave
AddHandler Label4.MouseLeave, AddressOf myLeave
AddHandler TextBox1.MouseEnter, AddressOf myEnter
AddHandler TextBox2.MouseEnter, AddressOf myEnter
AddHandler TextBox3.MouseEnter, AddressOf myEnter
AddHandler TextBox4.MouseEnter, AddressOf myEnter
AddHandler RadioButton1.MouseEnter, AddressOf myEnter
AddHandler RadioButton2.MouseEnter, AddressOf myEnter
AddHandler RadioButton3.MouseEnter, AddressOf myEnter
AddHandler RadioButton4.MouseEnter, AddressOf myEnter
AddHandler Label1.MouseEnter, AddressOf myEnter
AddHandler Label2.MouseEnter, AddressOf myEnter
AddHandler Label3.MouseEnter, AddressOf myEnter
AddHandler Label4.MouseEnter, AddressOf myEnter
End Sub
'...
#End Region
Private Sub myLeave(ByVal sender As Object, ByVal e As EventArgs)
Dim LeaveTextBox As TextBox = New TextBox()
Dim LeaveRadioButton As RadioButton = New RadioButton()
Dim LeaveLabel As Label = New Label()
If sender.GetType Is LeaveTextbox.GetType Then
LeaveTextBox = sender
LeaveTextBox.ForeColor = Color.Black
LeaveTextBox.Text = "Verlassen"
ElseIf sender.GetType Is LeaveRadioButton.GetType Then
LeaveRadioButton = sender
LeaveRadioButton.ForeColor = Color.Black
LeaveRadioButton.Text = "Verlassen"
ElseIf sender.GetType Is LeaveLabel.GetType Then
LeaveLabel = sender
LeaveLabel.ForeColor = Color.Black
LeaveLabel.Text = "Verlassen"
End If
End Sub
Private Sub myEnter(ByVal sender As Object, ByVal e As EventArgs)
Dim EnterTextBox As TextBox = New TextBox()
Dim EnterRadioButton As RadioButton = New RadioButton()
Dim EnterLabel As Label = New Label()
If sender.GetType Is EnterTextbox.GetType Then
EnterTextBox = sender
EnterTextBox.ForeColor = Color.Red
EnterTextBox.Text = "Eingetreten"
ElseIf sender.GetType Is EnterRadioButton.GetType Then
EnterRadioButton = sender
EnterRadioButton.ForeColor = Color.Red
EnterRadioButton.Text = "Eingetreten"
ElseIf sender.GetType Is EnterLabel.GetType Then
EnterLabel = sender
EnterLabel.ForeColor = Color.Red
EnterLabel.Text = "Eingetreten"
End If
End Sub
End Class
|
|