c# - Change BackColor of ToolStripItem on Mouse Over -


this question has answer here:

so have menustrip in c# trying darkish theme for, when press button dropdown menu well....

enter image description here

is there way make go white color? can't seem figure out way it. first time customizing context menus.

you use mousehover , mouseleave event. it's easy. following steps:

  1. we have form these items: http://s3.picofile.com/file/8188577184/capture.jpg

  2. choose dark backcolor toolstripmenuitem. choosed black color filetoolstripmenuitem in example.

  3. use mousehover event:

    private void filetoolstripmenuitem_mousehover(object sender, eventargs e) {         filetoolstripmenuitem.backcolor = color.white;         filetoolstripmenuitem.forecolor =color.black; } 
  4. use mouseleave event:

    private void filetoolstripmenuitem_mouseleave(object sender, eventargs e) {         filetoolstripmenuitem.backcolor = color.black;         filetoolstripmenuitem.forecolor = color.white; } 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -