VB.NET質問スレ (Part21 ..
367:デフォルトの名無しさん
07/05/25 21:01:44
>>363
希望するのはこういう動作?
Protected Overrides Sub OnLoad(ByVal e As System.EventArgs)
MyBase.OnLoad(e)
For Each c As Control In Me.Controls
AddHandler c.MouseMove, AddressOf Chileds_MouseMove
AddHandler c.MouseLeave, AddressOf Chileds_MouseLeave
Next
End Sub
Private Sub Chileds_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
Dim pt As Point = MousePositionByClientCoordinate()
Dim ev As New MouseEventArgs(e.Button, e.Clicks, pt.X, pt.Y, e.Delta)
MyClass.OnMouseEnter(New EventArgs)
Me.OnMouseMove(ev)
End Sub
Private Sub Chileds_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs)
MyClass.OnMouseLeave(New EventArgs)
End Sub
Private Function MousePositionByClientCoordinate() As Point
Return Me.PointToClient(Control.MousePosition)
End Function
Private Function IsMouseOnMe() As Boolean
Dim pt As Point = MousePositionByClientCoordinate()
Return Me.ClientRectangle.Contains(pt)
End Function
次ページ最新レス表示スレッドの検索類似スレ一覧話題のニュースおまかせリスト▼オプションを表示暇つぶし2ch
5091日前に更新/282 KB
担当:undef