Click here to Skip to main content
Click here to Skip to main content

Easy to Use Marquee Control for Windows Form with Full Designer Support

, 23 Mar 2008 CPOL
Rate this:
Please Sign up or sign in to vote.
Marque control implementation using .NET 2.0


This is a simple to use Marquee implementation for Windows Forms using .NET 2.0. This control allows you to customize itself easily and within seconds.


I was looking for a Marquee control for Window Forms. I found a couple but they were very restricted in features and moreover they were very restricted in events.

I decided to write a control which will fulfill all of my needs. Further it should be generic enough to be used by others too.


Marquee control has the following features:

  • Easy to use interface
  • Design time support for control and marquee element
  • ToolTip Support
  • Support of various events
  • Support for multicolor marquee
  • Support for left and right image in marquee element
  • Support for Font in marquee
  • Hover stop feature
  • Marquee element click and double click support
  • Notifies when lap is completed

Using Code

You can use this control in two ways.

Via Designer

Use dragdrop feature of Visual Studio. I will recommend to use the compiled assembly for references. Otherwise if recompiling of assembly is done, you will need to restart Visual Studio.

Add in designer

Use designer of SuperMarquee to modify the control.

Control designer

Use Properties of control to fine tune the rest of the properties:

Control properties

Use Element collection editor to modify TextElement collection:

Element collection editor

Use element designer to set element properties.

Element designer

Via Code

MarqueControl.Controls.SuperMarquee superMarquee1 = 
		new MarqueControl.Controls.SuperMarquee();

Use the following code to add element to the control:

TextElement element = new TextElement("Element text");
element.LeftImageIndex = 0;
element.RightImageIndex = 1;
element.IsLink = true;
element.ForeColor = Color.Red;
element.Tag = "Tag for element";
element.Font = new Font("Microsoft Sans Serif", 8.25F);
element.ToolTipText = "Tool tip for element";

Alternatively you can use the following code snippet to add a new range of elements:

MarqueControl.Entity.TextElement textElement1 = 
	new MarqueControl.Entity.TextElement("TextElement 1");
MarqueControl.Entity.TextElement textElement2 = 
	new MarqueControl.Entity.TextElement("TextElement 2");
MarqueControl.Entity.TextElement textElement3 = 
	new MarqueControl.Entity.TextElement("TextElement 3");
superMarquee1.Elements.AddRange(new MarqueControl.Entity.TextElement[] 

Events Description


This event is fired when user presses mouse button on the element text area.

private void superMarquee1_ItemClicked(object sender, ItemClickEventArgs e)
    MessageBox.Show("Item clicked :" + e.Index);


  1. This event is fired when any button is pressed.
  2. This event is fired only if clicked in text area of the element.


This event is fired when user double clicks on the element text area. This has similar features as of ItemClicked.

private void superMarquee1_ItemDoubleClicked(object sender, ItemClickEventArgs e)
    MessageBox.Show("Item double clicked :" + e.Index);


This event is fired when a lap is completed. Applicable only if AutoRewind is set to true. This event can be used in the following manner:

private void superMarquee1_LapCompleted(object sender, System.EventArgs e)
    MessageBox.Show("Lap completed.");


This event is fired before tooltip is popped. It supports cancellation of the tooltip being displayed. Apart from cancel feature, it supports the following:

  1. ToolTipText - Used to set ToolTip text
  2. Location - Used to set location of the tooltip
  3. Cancel - Used to cancel popup of tooltip

HitTest and HitTestInfo Object

HitTest() function can be used for get information on position of a point relative to the control.

HitTestInfo object contains the following properties:

  • Index - Index of the TextElement if point is above element otherwise it is -1
  • Point - Point where HitTest was performed
  • Area - HitTestArea at which point is located

HitTestArea enumeration contains the following members:

  • Item - Point is above Item. This does not include LeftImage or RightImage
  • LeftImage - Point is above LeftImage of the element
  • RightImage - Point was hit on RightImage of the element
  • Strip - Point was hit on Strip
  • Control - Point is inside the control, but not above Item, LeftImage, RightImage or Strip
  • None - Point is outside the bounds of control
HitTestInfo test = superMarquee1.HitTest(PointToClient(MousePosition));
    case HitTestArea.Item:
    case HitTestArea.LeftImage:
    case HitTestArea.RightImage:
    case HitTestArea.Strip:
    case HitTestArea.Control:
    case HitTestArea.None:

Alternatively you can create a new instance of the HitTestInfo class in the following manner:

HitTestInfo test = new HitTestInfo(superMarquee1, PointToClient(MousePosition));
    case HitTestArea.Item:
    case HitTestArea.LeftImage:
    case HitTestArea.RightImage:
    case HitTestArea.Strip:
    case HitTestArea.Control:
    case HitTestArea.None:

ToolTip and ToolTipData Object

To use tooltip property AutoToolTip must be set to true. Predefined tooltip can be used or dynamic tooltip can also be used using event BeforeToolTip.

The following code snippet illustrates how to add dynamic tooltip to the element.

private void superMarquee1_BeforeToolTip
	(object sender, GenericCancelEventArgs <ToolTipData> tArgs)
     tArgs.Value.ToolTipText = "New dynamic text based on condition.";

The code below will illustrate how to change the position of the tooltip being displayed.

private void superMarquee1_BeforeToolTip
	(object sender, GenericCancelEventArgs<ToolTipData> tArgs)
     tArgs.Value.Location = 
	new Point(tArgs.Value.Location.X + 10, tArgs.Value.Location.Y + 20);

This is how your tooltip display can be cancelled.

private void superMarquee1_BeforeToolTip(object sender, GenericCancelEventArgs<tooltipdata /> tArgs)
     tArgs.Cancel = true;

Points of Interest



  • HoverStop - Gets or sets that marquee will be running or not if mouse hover is there
  • AutoRewind - Gets or sets on completion of one round of marquee it will start again or not
  • Elements - Gets list of the TextElement associated with the control.
  • Running - Gets or sets whether marquee is running or not
  • AutoToolTip - Gets or sets whether tool tip will be shown automatically
  • ImageList - Gets or sets the ImageList associated with the component
  • StripColor - Gets or sets the Color of the stripe. Enable ShowStrip for displaying the strip.
  • ShowStrip - Gets or sets that strip will be shown or not.
  • MarqueeSpeed - Gets or sets the Speed of the marquee. Maximum speed is 999 and minimum speed is 1.


  • ItemClicked - Fired when Item is clicked
  • ItemDoubleClicked - Fired when Item is double clicked
  • LapCompleted - Fired when lap is completed
  • BeforeToolTip - Fired when ToolTip is about to display


  • HitTest() - Performs the HitTest
  • Reset() - Reset the control
  • ResetMorquee() - Reset the marquee of control
  • StartMarquee() - Starts marquee
  • StopMarquee() - Stops marquee



  • Text - Text displayed in this element
  • ForeColor - Text color of the element
  • IsLink - Indicates whether the element will be displayed as a link or not
  • Font - Font of this element
  • Tag - User data associated with the element
  • LeftImageIndex - Left image index of the image to be displayed
  • RightImageIndex - Right image index of the image to be displayed
  • ToolTipText - Text displayed in this element


  • Reset() - Reset the element

Known Issues

  • At high speed, flickering is there
  • Element jumping is sometimes not proper


  • 24 March 2008: Initial draft of the control


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Manish Ranjan Kumar
Software Developer (Senior)
India India
No Biography provided

Comments and Discussions

GeneralMy vote of 2 PinmemberMember 99931079-Oct-14 10:53 
GeneralMy vote of 5 PinmemberAsif Iqbal A.Khan5-Jun-13 0:03 
QuestionHow would you change the scroll direction? PinmemberMark Kestenbaum13-Jun-12 6:55 
BugBug: Does not scroll with one element PinmemberMark Kestenbaum13-Jun-12 3:29 
Questiontop to bottom Pinmemberdizpers20-Jun-11 2:18 
QuestionHow's Smooth tuning Pinmemberaromdee0413-Jun-11 22:09 
GeneralEasy to Use Marquee Control for Windows Form with Full Designer Support by Manish Ranjan Kumar PinmemberAnk_ush8-Apr-11 2:27 
GeneralLEFT TO RIGHT?!!! PinmemberHOUMAN MASNAVI2-Aug-10 14:25 
GeneralMy vote of 5 Pinmembermhedenberg20-Jul-10 17:04 
GeneralFlickering Pinmembermidhat13-Mar-10 2:13 
GeneralRe: Flickering Pinmemberhgfhfgfsdfsdf30-Aug-10 3:29 
GeneralRe: Flickering PinmemberMember 74095418-Oct-10 8:22 
GeneralFlickering and crash PinmemberJörgen Björkman17-Feb-09 0:36 
GeneralRe: Flickering and crash Pinmemberimresoft30-Dec-09 1:32 
Generalchange text at runtime Pinmemberdahras30-Jan-09 7:04 
GeneralABSOLUTELY BRILLIANT WORK ! (Small bug there though) PinmemberSymatrix14-Jan-09 9:05 
GeneralRe: ABSOLUTELY BRILLIANT WORK ! (Small bug there though) PinmemberLazer323-Dec-09 10:36 
GeneralRe: ABSOLUTELY BRILLIANT WORK ! (Small bug there though) Pinmemberimresoft30-Dec-09 1:20 
GeneralIDE crashes PinmemberZerus Zocker29-Nov-08 2:06 
GeneralRe: IDE crashes Pinmemberdahras30-Jan-09 7:26 
GeneralRe: IDE crashes Pinmemberwissam_alkordi2-Mar-09 15:28 
GeneralRe: IDE crashes Pinmemberfaisal008139-Jul-09 6:19 
GeneralRe: IDE crashes PinmemberDoeYs9-Nov-12 3:48 
Questiongood Pinmemberameer008628-Nov-08 20:52 
GeneralGreat Work PinmemberAhmedA112-Oct-08 2:55 
AnswerRe: Great Work PinmemberManish Ranjan Kumar13-Oct-08 1:35 
QuestionDatabase PinmemberTcode19-Sep-08 4:47 
AnswerRe: Database PinmemberMember 446164220-Feb-09 5:24 
Generalerror in visual studio 2008 [modified] Pinmemberpolgei27-Jul-08 4:04 
AnswerRe: error in visual studio 2008 PinmemberManish Ranjan Kumar13-Oct-08 1:36 
GeneralVista Compatability PinmemberMember 467023527-May-08 10:53 
GeneralRe: Vista Compatability PinmemberManish Ranjan Kumar28-May-08 5:17 
GeneralTest Program gives an error with Visual Studio 2008 Pinmembergokhansumer31-Mar-08 20:35 
AnswerRe: Test Program gives an error with Visual Studio 2008 PinmemberManish Ranjan Kumar1-Apr-08 0:36 
GeneralCool!!! Pinmemberprashudupa28-Mar-08 3:15 
GeneralCannot get the marquee to start Pinmemberphanie27-Mar-08 23:59 
AnswerRe: Cannot get the marquee to start PinmemberManish Ranjan Kumar28-Mar-08 1:18 
AnswerRe: Cannot get the marquee to start PinmemberManish Ranjan Kumar28-Mar-08 1:19 
GeneralRe: Cannot get the marquee to start PinmemberLazer323-Dec-09 8:06 
GeneralRe: Cannot get the marquee to start PinmemberLazer323-Dec-09 9:26 
GeneralLooks good PinmemberDerek Bartram24-Mar-08 14:17 
GeneralVery Cool PinmemberF16I24-Mar-08 7:06 
GeneralNice! PinmemberRavi Bhavnani24-Mar-08 3:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.150327.1 | Last Updated 24 Mar 2008
Article Copyright 2008 by Manish Ranjan Kumar
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid