세 개의 그림 상자가있는 새 폼을 만듭니다. 이 코드는 마우스가 그림 상자로 들어 와서 떠날 때 테두리를 그릴 때 사용됩니다. 결과에 일관성이 없습니다. 때로는 테두리를 그립니다. 때로는 테두리를 그립니다. 이 코드는 복잡하지 않습니다. VS 2012 사용.PictureBox MouseEnter/MouseLeave 발생하지 않는 이벤트
Private Sub PictureBox_MouseEnter(sender As Object, e As EventArgs) _
Handles PictureBox1.MouseEnter, PictureBox2.MouseEnter, PictureBox3.MouseEnter
Dim pb As PictureBox = DirectCast(sender, PictureBox)
pb.BorderStyle = BorderStyle.FixedSingle
' Debug.WriteLine("E " & pb.Name)
End Sub
Private Sub PictureBox_MouseLeave(sender As Object, e As EventArgs) _
Handles PictureBox1.MouseLeave, PictureBox2.MouseLeave, PictureBox3.MouseLeave
Dim pb As PictureBox = DirectCast(sender, PictureBox)
pb.BorderStyle = BorderStyle.None
' Debug.WriteLine("X " & pb.Name)
End Sub
'PictureBox' 컨트롤에는 그 안에 자식 컨트롤이 있습니까? – EkoostikMartin
아니요. 새로운 양식, 위에 세 개의 그림 상자와 코드를 추가하십시오. – dbasnett
어떤 플랫폼입니까? Winforms, WPF? – OneFineDay