i want to blink one baritem. the problem is: i don''t know how to force a repaint.
i use this code with a workaround:
bool bLastBlink = false;
private void barItemZurück_DrawToolbarItem(object sender, Syncfusion.Windows.Forms.Tools.XPMenus.DrawToolbarItemEventArgs drawItemInfo)
Graphics g = drawItemInfo.Graphics;
g.FillRectangle(brushRed, drawItemInfo.Bounds.X, drawItemInfo.Bounds.Y, drawItemInfo.Bounds.Width, drawItemInfo.Bounds.Height);
private void timerBlink_Tick(object sender, System.EventArgs e)
bLastBlink = !bLastBlink;
barItemZurück.Text = barItemZurück.Text + " "; // HACK: please fix
i use this to force a repaint:
barItemZurück.Text = barItemZurück.Text + " ";
how can i do it the right way???
ADAdministrator Syncfusion Team April 19, 2005 11:13 AM
Have you tried calling Invalidate() on the bar that the BarItem is part of? That should solve your problem, though if you''re using MainFrameBarManager you''ll need to use the GetBarControl method first to get a reference to the actual control used to display the Bar.
ADAdministrator Syncfusion Team April 20, 2005 10:33 AM
i''m using a childframebarmanager. getbarcontrol gives me a null reference. what should i do???
> Have you tried calling Invalidate() on the bar that the BarItem is part of? That should solve your problem, though if you''re using MainFrameBarManager you''ll need to use the GetBarControl method first to get a reference to the actual control used to display the Bar.
ADAdministrator Syncfusion Team April 20, 2005 02:25 PM
Did you create a Bar with the same name in the MainFrameBarManager as your Bar in the ChildFrameBarManager? That might solve your problem.
Alternatively, you could just update every Bar Control with the following code snippet:
foreach (Bar b in this.mainFrameBarManager1.Bars)
If neither of these works, could you send me a sample so that I could take a look at your application?
CPChristian PogeaApril 21, 2005 06:17 AM
sorry, it doesn''t work.
please use my sample to get it work for me.
ADAdministrator Syncfusion Team April 21, 2005 10:32 AM
I''ve looked into this further and discovered that the Bar only repaints the BarItem when one of it''s properties is changed. So to get a BarItem to repaint, you need to fire a PropertyChanged event. Do this, you need to extend the class.
The following code snippet is an extension of BarItem that adds the Blink property. Changing this property will cause the BarItem to be repainted.
public class BlinkBarItem : Syncfusion.Windows.Forms.Tools.XPMenus.BarItem
public BlinkBarItem() : base()
private bool blink;
public bool Blink
if (blink != value)
blink = value;
this.OnPropertyChanged(new Syncfusion.ComponentModel.SyncfusionPropertyChangedEventArgs(Syncfusion.ComponentModel.PropertyChangeEffect.NeedLayout, "Blink", !blink, blink));