Note that there are some explanatory texts on larger screens.

plurals
  1. PO.NET UserControl's MouseLeave strange behavior
    primarykey
    data
    text
    <p>I have a userControl (.NET 1.1 Winforms) that has a clickable picturebox as a button.</p> <p>Since I have lots of those usercontrols visible at the same time, I thought It could be nice if I just display the picture box when the mouse is over the usercontrol and hide it otherwise.</p> <p>To do so, I handle the MouseEnter and MouseLeave events of the UserControl, hiding and displaying the picturebox. That works fine.</p> <p>But when the clickable picturebox is visible I'm not longer able to click it (the hand cursor is gone and the click event is not firing).</p> <p>After some test, I realize that if comment all content on the MouseLeave handler that do something with my picturebox... this way the picturebox is clickable.</p> <p><strong>I'm not using the correct event?</strong></p> <p><strong>There's another way to accomplish this?</strong></p> <p>Here is the code...</p> <pre><code>Private Sub NodoEstablo_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Me.pictAdd.Visible = False End Sub Private Sub NodoEstablo_MouseEnters(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.MouseEnter Me.pictAdd.Visible = True End Sub </code></pre> <p>The problematic event handler:</p> <pre><code>Private Sub NodoEstablo_MouseLeaves(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.MouseLeave Me.pictAdd.Visible = False End Sub </code></pre> <p>Update: If I resize the picturebox on MouseLeave (just to do something) it works. So far, changing Visible and Location in the MouseLeave prevent me for click the picturebox. :S</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload