This control has the following properties: Also, you can create a separate class library for the Scroller class. You can simply copy the Scroller class to your project to use it.
The Scroller class represents an easy-to-use component with customizable font, background color, text color and, of course, text content.
using (Brush br = new LinearGradientBrush( new Point( 0, 0),Ĭolor.FromArgb( 255, this.BackColor), Color.FromArgb( 0,Į.Graphics.FillRectangle(br, this.ClientRectangle)
First of all, we need to enable anti-aliasing for better quality:Ĭopy Code // Draws fog effect with help of gradient brush with alpha colors. The most useful code is situated in the Paint event handler. On the timer tick, we'll change this variable and repaint the control. To animate our transformed text, we'll use an offset variable and timer. We can create this "outgoing" effect by transforming all points of text from rectangular to trapezoidal shape: After that, I decided to write this article to demonstrate some features of GDI+. It seemed to be a hard task, but later I recreated this same component in GDI+. This required much more time and resulted in ten times more code. Before writing this component with the help of GDI+, I tried to create it with GDI. Using these functions, you can do something special without much trouble. GDI+ provides many easy-to-use objects and functions. I decided to write an "outgoing" text component, which looks like a 3D effect such as in the intro to the Star Wars movies. In this article, I attempted to create something unusual. In most cases, it's a simple colored text that moves up. You can find text scrollers in many programs, especially in their About dialogs.