Teil2
Private Sub tmrToolTip_Tick(ByVal sender As System.Object, ByVal e As _
System.EventArgs) Handles tmrToolTip.Tick
Dim p As Point
If TypeOf Con Is ListView Then
If CType(Con, ListView).Items.Count = 0 Then
tmrToolTip.Enabled = False
Hauptfenster.TipShow = False
Me.Dispose() : Exit Sub
End If
End If
If Not IsNothing(Con) Then
p = Con.PointToClient(Cursor.Position)
If Con.ClientRectangle.Contains(p) = False Then
tmrToolTip.Enabled = False
Hauptfenster.TipShow = False
Me.Dispose() : Exit Sub
End If
End If
If DauerZeige = 0 Then
tmrToolTip.Interval = 10
If Me.Opacity > 0.0 Then
Me.Opacity -= 0.01
ElseIf Me.Opacity = 0.0 Then
tmrToolTip.Enabled = False
Hauptfenster.TipShow = False
Me.Dispose() : Exit Sub
End If
Else
DauerZeige -= 1
End If
Exit Sub
End Sub
Private Sub frmToolTip_FormClosing(sender As Object, e As _
FormClosingEventArgs) Handles Me.FormClosing
Hauptfenster.TipShow = False : tmrToolTip.Enabled = False
End Sub
Private Sub frmToolTip_Load(ByVal sender As Object, ByVal e As _
System.EventArgs) Handles Me.Load
Dim desktopSize As Size
desktopSize = System.Windows.Forms.SystemInformation.PrimaryMonitorSize
Dim height As Integer = desktopSize.Height
Dim width As Integer = desktopSize.Width
Me.Height = CInt(Me.CreateGraphics().MeasureString(Me.lblToolTip.Text, _
Me.Font).Height) + 8
If (Me.Top + Me.Height) > height Then
Me.Top = ((Cursor.Position.Y - 5) - Me.Height)
End If
Me.Width = CInt(Me.CreateGraphics().MeasureString(Me.lblToolTip.Text, _
Me.Font).Width) + 8
If (Me.Left + Me.Width) > width Then
Me.Left = ((Cursor.Position.X - 5) - Me.Width)
End If
Hauptfenster.TipShow = True
Me.Owner = Hauptfenster
Me.Show()
End Sub
Private Sub frmToolTip_Paint(sender As Object, e As _
System.Windows.Forms.PaintEventArgs) Handles Me.Paint
Using g As Graphics = Graphics.FromHdc(GetWindowDC(Me.Handle)), p As _
New Pen(Color.FromArgb(118, 118, 118), 1)
p.Alignment = Drawing2D.PenAlignment.Inset
g.DrawRectangle(p, 0, 0, Me.Width - 1, Me.Height - 1)
End Using
End Sub
End Class Und dieser ToolTip wird unter ListView MouseMove
frmToolTip.Zeigen(sender, Tabelle.List(y).Notiz, 500) aufgerufen.
Bei mir funktioniert alles Prima, nur bei meinem Vater hängt es Bei ersten Programm Start auf.
Laut Information reagiert ToolTip-Fomular nicht.
Aber wenn mein Vater das Programm per Taskmanager schließt, und wieder startet, läuft das Programm wie geschmiert.
Woran kann es liegen?
|