CrackAndLoad



 
HomePortalCalendarFAQSearchMemberlistUsergroupsRegisterLog in
Welcome To CrackAndLoad! Please Be Active And Read Our Forum Rules To Avoid Get Banned! Enjoy !

Share | 
 

 Scrolling Label Function

View previous topic View next topic Go down 
AuthorMessage
CodeBlack

HYPER MODERATOR

avatar

Posts : 75
Post/Message Points : 175
Thanks : 26
Join date : 2012-12-01

PostSubject: Scrolling Label Function   Thu Dec 27, 2012 2:15 pm

Hello, just thought I'd release a scrolling label text function that I made.
Code:
  void scrollText(ref Label lbl, string lblText, int maxCharDisplay)
        {
            string lblTextTotal = lblText + lblText;
            if (maxCharDisplay > (lblText.Length - 1)) maxCharDisplay = (lblText.Length - 1);
            if (lbl.Tag == null) lbl.Tag = 0;
            int curIndex = Convert.ToInt32(lbl.Tag.ToString());
            lbl.Text = lblTextTotal.Substring(curIndex, maxCharDisplay);
            curIndex++;
            if (curIndex > (lblText.Length - 1)) curIndex = 0;
            lbl.Tag = curIndex;
        }

If you want a label in your form to scroll some text.

Code:
scrollText(ref Label1, "BETA--", 10);

ut that inside of a timer, or whenever you want it to scroll just use that code above.




Quote :

This forum requires that you wait 60 seconds between sending private messages. Please try again in 1 seconds.

=====================================================================
Quote :
Coder [✔️]

Visual Basic [✔️]

Visual C++ [✔️]

Programming [✔️]

Cabal Hack [✔️]

WarRock Hack [✔️]

USF HACK [✔️]

CF Hack

SF Hack

=====================================================================
Teacher's
GLenox
DOOP



CodeBLacK CNL Moderator
Back to top Go down
View user profile
 

Scrolling Label Function

View previous topic View next topic Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
CrackAndLoad :: Computer Programming :: C# Programming-