Click here to Skip to main content
13,346,397 members (64,124 online)
Click here to Skip to main content
Add your own
alternative version


26 bookmarked
Posted 27 Dec 2006

Nice Movie Cast (Text Scroller)

, 23 Mar 2008
Rate this:
Please Sign up or sign in to vote.
Scrolling text with music (just like those in movies' ends!!)
Sample Image - Movie_Cast.jpg


I've always admired the way movies end, especially when they put a good music that could make up for the stupid movie and lets me forget the bitterness of thinking about the time I wasted watching this movie!!

Well, hopefully I'm making a good movie cast now, but hey, I ain't making up nothing!!


Three main events were declared on the form level for this cast:

  • Load: To load the music and start off the scrolling process
  • MouseEnter: To pause the scrolling
  • MouseLeave: To resume scrolling

For the two mouse events, I've attached two timers to be triggered.

Oh, just two ordinary timers to scroll/pause the cast text.

  • tmrScroller would control the text movement and determine it has reached an end and if so, it's dead!! That is using the kill_Scroller method.
  • tmrPause to show the blinking pause sign at the bottom.

Notice that real pausing was already carried out in the MouseEnter event that in turn launched the tmrPause.

Well, I think that's it for the explanation. Let's go and take a peek at the code.

The Code

//By Muammar Yacoob
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using tonysound;
//Thanks to Tony for making the sound implementation easier
namespace Movie_Cast
    public partial class Cast : Form
        public Cast()

        private void Cast_Load(object sender, EventArgs e)
            //scrolling timer is started
            //sound is played on form loading
            Sound.Play("0X07.wav", PlaySoundFlags.SND_ASYNC);

        private void tmrScroller_Tick(object sender, EventArgs e)
            if (txtCast.Location.Y > (txtCast.Height * -1))
            //textbox's bottom "txtCast" is still in the window
                txtCast.Location = new Point(txtCast.Location.X, 
                   txtCast.Location.Y - 1);
                   // move txtCast up 1 pixel
                kill_Scroller(); //ok, txtCast is out now!

        private void kill_Scroller()
            label1.Visible = true;
            lnk_website.Visible = true;
            //to cover the lower stuff:)

        private void Cast_FormClosed(object sender, 
                                     FormClosedEventArgs e)
                 //to stop the sound

        private void lnk_website_LinkClicked(object sender, 
                     LinkLabelLinkClickedEventArgs e)
            System.Diagnostics.Process.Start("http://" + 

        private void Cast_MouseEnter(object sender, 
                     EventArgs e) //enter pause mode
            lbl_Pause.Visible = false;

        private void Cast_MouseLeave(object sender, 
                     EventArgs e) //back to scroll mode
            lbl_Paused.Visible = false;
            panel3.Visible = false;
            panel4.Visible = false;
            lbl_Pause.Visible = true;

        private void tmrPause_Tick(object sender, EventArgs e)
            if (lbl_Paused.Visible == false)
                lbl_Paused.Visible = true;
                panel3.Visible = true;
                panel4.Visible = true;
                lbl_Paused.Visible = false;
                panel3.Visible = false;
                panel4.Visible = false;


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


About the Author

Retired QSoft
Yemen Yemen
Biography?! I'm not dead yet!

You may also be interested in...

Comments and Discussions

GeneralMy vote of 1 Pin
TV Mogul14-Sep-10 3:15
memberTV Mogul14-Sep-10 3:15 
there is no project file and the one cs file is incomplete and won't compile
Generalit's cool Pin
Claud.Xing26-Aug-07 3:49
memberClaud.Xing26-Aug-07 3:49 
GeneralDesigner Code Pin
Polymorpher3-Jan-07 17:22
memberPolymorpher3-Jan-07 17:22 
GeneralRe: Designer Code Pin
Muammar©5-Jan-07 23:41
memberMuammar©5-Jan-07 23:41 

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

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

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.180111.1 | Last Updated 23 Mar 2008
Article Copyright 2006 by Muammar©
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid