Posted 19 years ago
by byperman
- Sint-Niklaas, Belgium
Hi,
I'm trying to implement a DisappearingLineIndicator, similar to the DisappearingIndicator that highlights a line (changing the backcolor) instead of making the text bold.
I'm not really sure how to do this, however. Could anyone tell me how to do this?
Thanks,
Brecht
I'm trying to implement a DisappearingLineIndicator, similar to the DisappearingIndicator that highlights a line (changing the backcolor) instead of making the text bold.
I'm not really sure how to do this, however. Could anyone tell me how to do this?
Thanks,
Brecht
/// <summary>
/// Summary description for DisappearingLineIndicator.
/// </summary>
public class DisappearingLineIndicator : SpanIndicator
{
private Timer f_timer;
private Color f_color;
private HighlightingStyle f_style;
public DisappearingLineIndicator(int milliSeconds, Color color) : base("DissapearingLineIndicator", 10, false, IndicatorMarks.StyleAssignment)
{
f_color = color;
f_style = new HighlightingStyle("DisappearingLineIndicator", "DisappearingLineIndicator", Color.White, f_color, false, false, false);
f_timer = new Timer(milliSeconds);
f_timer.Elapsed += new ElapsedEventHandler(f_timer_Elapsed);
}
protected override void DrawMarks(Graphics g, Rectangle bounds)
{
}
protected override HighlightingStyle GetHighlightingStyle()
{
return f_style;
}
protected override void OnAdded(IndicatorEventArgs e)
{
base.OnAdded (e);
f_timer.Start();
}
private void f_timer_Elapsed(object sender, ElapsedEventArgs e)
{
f_timer.Stop();
// Something should happen here...
}
}