Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7511369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T23:31:34+00:00 2026-05-29T23:31:34+00:00

hello atm I have this code private void checkBox1_CheckedChanged(object sender, EventArgs e) { if

  • 0

hello atm I have this code

    private void checkBox1_CheckedChanged(object sender, EventArgs e)
    {
        if (checkBox1.Checked == true)
        {
            x = 0;
            timer1.Enabled = true;
            timer1.Start();
        }
        else
        {
            timer1.Enabled = false;
        }
    }
    private int x = 0;
    private int y = 0;
    private void timer1_Tick(object sender, EventArgs e)
    {
        if (x <= 10)
        {
            x++;
            string ping = new string(' ', x) + "hello";
            label1.Text = ping;
            if (x == 10)
            {
                y = 10;
            }
        }
        else if (y > 0)
        {
            y--;
            string pong = new string(' ', y) + "hello";
            label1.Text = pong;
            if (y == 0)
            {
                x = 0;
            }
        }
    }

at the moment the label has a maximum length of 15 characters and i want it to stay that way.

but i want it to instead of using “hello” to take the text i input into a textbox and do it.

however it has to take 15 and subtract the length of the textboxes text in order to keep the labels max length of 15 intact while displaying the entire word in the textbox aswell but i cant figure out how to do it i have tried plenty of things but i cannot figure it out any help would be greatly appreciated. 😀

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T23:31:35+00:00Added an answer on May 29, 2026 at 11:31 pm

    Your use of the words “ping” and “pong”, plus your title saying “move back and forth” leads me to believe the result you want can be achieved by changing the TextAlign property of the label upon each tick.

    If this is the result you want, you won’t have to add spaces at all. The text will appear to go from left to right edges in the label. You might consider trimming the text property with TRIM() to ensure no spaces exist on either side that would make it appear aligned incorrectly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello i have this code var queue = new BlockingCollection<int>(); queue.Add(0); var producers =
Hello can anybody solve this please I'm creating the object in the action class
Let's say we have the following in vim atm: int main () { printf(hello);
hello all i have one json object like {event1:{title:My birthday,start:12\/27\/2011 10:20 ,end:12\/27\/2011 00:00 },event2:{title:My
Hello I have this query... if (isset($_REQUEST['deletePost'])) { $q = $dbc -> prepare(DELETE FROM
Hello I have this problem with PyQt4-dev-tools that include: * a user interface compiler
Hello I have the following error by git-fsck, which cannot be cleaned by git-gc
Hello I am working with a simulator that uses rcS scripts to boot, this
Hello we have an SQL server application running over a low bandwith connection. We
Hello I have two text inputs which get their values from a datepicker. What

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.