We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

BarItem Blink

Thread ID:

Created:

Updated:

Platform:

Replies:

27835 Apr 19,2005 12:44 PM UTC Apr 21,2005 03:32 PM UTC WinForms 5
loading
Tags: Tools
Christian Pogea
Asked On April 19, 2005 12:44 PM UTC

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) { drawItemInfo.DrawBackground(); Graphics g = drawItemInfo.Graphics; if (bLastBlink) g.FillRectangle(brushRed, drawItemInfo.Bounds.X, drawItemInfo.Bounds.Y, drawItemInfo.Bounds.Width, drawItemInfo.Bounds.Height); drawItemInfo.DrawBorders(); drawItemInfo.DrawInterior(); } 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???

Administrator [Syncfusion]
Replied On April 19, 2005 04:13 PM UTC

Hi Christian, 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. Regards, Gregory Austin Syncfusion Inc.

Administrator [Syncfusion]
Replied On April 20, 2005 03:33 PM UTC

hi, i''m using a childframebarmanager. getbarcontrol gives me a null reference. what should i do??? >Hi Christian, > > 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. > >Regards, >Gregory Austin >Syncfusion Inc.

Administrator [Syncfusion]
Replied On April 20, 2005 07:25 PM UTC

Hi, 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) { this.mainFrameBarManager1.GetBarControl(b).Invalidate(); } If neither of these works, could you send me a sample so that I could take a look at your application? Regards, Gregory Austin Syncfusion Inc.

Christian Pogea
Replied On April 21, 2005 11:17 AM UTC

sorry, it doesn''t work. please use my sample to get it work for me. best ragards, christian pogea BarBlink_9705.zip

Administrator [Syncfusion]
Replied On April 21, 2005 03:32 PM UTC

Hi Christian, 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 { get { return blink; } set { if (blink != value) { blink = value; this.OnPropertyChanged(new Syncfusion.ComponentModel.SyncfusionPropertyChangedEventArgs(Syncfusion.ComponentModel.PropertyChangeEffect.NeedLayout, "Blink", !blink, blink)); } } } } Regards, Gregory Austin Syncfusion Inc.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;