c# - choosing to hide or show tooltips based on bool -


so figured i'm making stupid mistake here. in first of many controls, need either show balloon tooltip when bool true or not show them when bool false. know showalways not need modify , i've tried various solutions already. spot problem? bool set checked dropdown item in menu strip item.

it open application correct display, check option show it, shows there after.

public void changeballoonproperties(bool boolset)         {             tooltip helpdeskinfobuttontooltip = new tooltip();             if (boolset)             {                 helpdeskinfobuttontooltip.tooltiptitle = "helpdesk information button";                 helpdeskinfobuttontooltip.usefading = true;                 helpdeskinfobuttontooltip.useanimation = true;                 helpdeskinfobuttontooltip.isballoon = true;                 helpdeskinfobuttontooltip.showalways = true;                 helpdeskinfobuttontooltip.autopopdelay = 5000;                 helpdeskinfobuttontooltip.initialdelay = 1000;                 helpdeskinfobuttontooltip.reshowdelay = 500;                 helpdeskinfobuttontooltip.settooltip(helpdeskbutton, "click launch helpdesk user info page in default browser.");             }             else             {                 helpdeskinfobuttontooltip.removeall();             }         } 

you creating new tooltip instance each time changeballoonproperties called code isn't removing caption associated original tooltip used helpdeskbutton. try moving tooltip declaration outside of changeballoonproperties method same tooltip object used removeall().

also note can use same tooltip object add captions multiple controls (as shown in sample here) , it's better set helpdeskinfobuttontooltip.active = false disable them @ once instead of setting , removing captions (and other properties) each time toggle.


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -