Interesting Cmdbar behaviour

Add-in Express™ Support Service
That's what is more important than anything else

Interesting Cmdbar behaviour
 
Kristjan H




Posts: 27
Joined: 2005-10-29
Hi

I created new toolbar with one button. Then i placed Timer control to addin form. Timer is updating this button caption wiht current time.

Its very interesting that that button caption is updated by timer when toolbar is undocked but when i place bar to top toolbars uptdating occures only i focus the button.

i didnt found any way to refresh caption.

pls help

Kristjan
Posted 31 Oct, 2005 08:01:56 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Kristjan,

Unfortunately there is no Refresh/Update method of the CommandBarControl interface. But after changing the caption you can try to increase/decrease the Width of your button for it to be repainted.

Posted 31 Oct, 2005 08:51:09 Top
Kristjan H




Posts: 27
Joined: 2005-10-29
mybar2.Controls.Items[1].Width:= mybar2.Controls.Items[1].Width-1;
mybar2.Controls.Items[1].Caption:=timetostr(now());
mybar2.Controls.Items[1].Width:= mybar2.Controls.Items[1].Width+1;

looks strange but works, only if its not last control in bar
Posted 31 Oct, 2005 14:56:34 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Kristjan,

looks strange but works, only if its not last control in bar


Even more strange than it seems because in my case all controls including the last are repainted.
Posted 02 Nov, 2005 07:13:15 Top