Results 1 to 4 of 4

Thread: [2.0][3.0] OnMouseEvent for Buttons[RESOLVED]

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member Rattlerr's Avatar
    Join Date
    Jul 2005
    Location
    FloralCity,Florida
    Posts
    269

    Smile [2.0][3.0] OnMouseEvent for Buttons[RESOLVED]

    coming across a slight problem with the MouseEnter or MouseHover Events,cant seem to get the code correct...getting the BackColor of the Button to change when the Cursor goes over the button..

    VB Code:
    1. private void button1_OnMouseEnter(object sender, MouseEventArgs e)
    2.         {
    3.             base.OnMouseEnter(e);
    4.             if (button1.BackColor == Color.Black)
    5.                 button1.BackColor = Color.DarkBlue;
    6.             else
    7.                 base.OnMouseLeave(e);
    8.             button1.BackColor = Color.Black;
    9.         }
    10. // I'v tried this serveral different ways version 2
    11.  
    12. protected override void OnMouseEnter(EventArgs e)
    13.  
    14. {
    15.  
    16. base.OnMouseEnter(e);
    17.  
    18. button1.BackColor = Color.DarkBlue;
    19.  
    20.  
    21. }
    22.  
    23.  
    24. protected override void OnMouseLeave(EventArgs e)
    25.  
    26. {
    27.  
    28. base.OnMouseLeave(e);
    29.  
    30. button1.BackColor = Color.Black;
    31.  
    32. }

    I also tried using the "protected override void"
    Last edited by Rattlerr; Jul 19th, 2006 at 09:20 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width