ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.


AddThis Social Bookmark Button
  C# News Ticker Multithreaded Application
Subject:   To make this work properly...
Date:   2003-09-12 07:37:49
From:   generalpf
Add this to the class:

private delegate void TickerDelegate(String s);
private TickerDelegate tickerDelegate1, tickerDelegate2;

In the constructor, add this:

tickerDelegate1 = new TickerDelegate(SetLeftTicker);
tickerDelegate2 = new TickerDelegate(SetRightTicker);

Add these functions to the class:

private void SetLeftTicker(String s)
label1.Text = s;
private void SetRightTicker(String s)
label2.Text = s;

And finally, replace "label1.Text =" with this:
label1.Invoke(tickerDelegate1,new object[] { headline.Substring(0,i) });

This is the proper way to do it.

1 to 2 of 2
  1. To make this work properly...
    2003-11-05 17:08:57  anonymous2 [View]

  2. To make this work properly...
    2003-09-12 07:39:00  generalpf [View]

1 to 2 of 2