Tutorials Navigation
C# Simple Scrolling Text Tutorial
Tutorial Name: C# Simple Scrolling Text Tutorial
Category: PC Tutorials
Submitted By: Nissan
Date Added:
Comments: 0
Views: 5,812
Related Forum: PC Building Forum
Share:
How To Make A Simple Scrolling Text In C#.
We are going to start off by making a form and adding the following items from the tool box to your form :
1 label,
1 button,
1 timer.
Once you have them double click on your timer to get the event handler.
Now you will see some code and it will look like this :
[ Register or Signin to view external links. ]
Now put the following code into the timer :
//This Line Of Code Is To Refresh The Timer
this.Refresh();
// This Line Of Code Is The Speed You want It To Scroll At.
label1.Left += 5;
//This If Statement Is What Makes The Label Scroll
if (label1.Left >= this.Width)
label1.Left = label1.Width * 1;
Now if you debug (run) your program your label will scroll if it doesn't that will be because of the timer enabled is set to false to change it to true you can use an if statement or go into the timer properties and set enabled to true i will now show you the way using a button and not using a button.
We will do the non button way first so go back to the design view and click on your timer at the bottom and you will see the properties tab on the right and this is what it looks like :
[ Register or Signin to view external links. ]
Now if you see enabled is false change it to true and debug (run) your program your label will scroll.
Ok so now we have done that way i will show you how to enable / disable the timer when you click the button so it will stop / start the label from scrolling.
Now double click on your button so you can get the event handler and put the following code into the button event handler :
if(timer1.Enabled == false)
{
timer1.Enabled = true;
}
else
{
timer1.Enabled = false;
}
Now debug (run) your program and when you click the button the timer will either start or stop the scrolling text.
Hope you have learned something from this tutorial
Ratings
Comments
Related Tutorials
- 01. Emulating Xbox 360 on PC for Running COD4 With Mods(3,656)
- 02. How to: Matrix Numbers | Batch File(1,954)
- 03. How to Password Protect Files on Windows(865)
- 04. How to play Socom 2/3/ and Combined Assault on PC(6,879)
- 05. Modern Warfare 2 Vac Ban Bypass Tutorial(6,243)
- 06. How to embed an image on TheTechGame(3,140)
- 07. [PC] NIOH 2 OTHER USER SAVE RESIGN(13,088)
- 08. Host bot lobbies! Full Tutorial!(11,610)
- 09. Unban yourself [Plutonium BO2](14,308)
- 10. Fall Guys - How to Change Your Name Color on Fall Guys(8,410)
- 11. Best Crosshair Settings for Valorant(6,550)
- 12. Othercide The Surgeon Boss Guide(2,568)
- 13. Othercide Remembrances Unlock Guide(4,517)
- 14. Othercide Beginners Tips and Tricks(2,734)
- 15. How to Fix Grounded Crashes, Loading Time, Low FPS and Other(4,881)
"C# Simple Scrolling Text Tutorial" :: Login/Create an Account :: 0 comments