Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void btn_BottomLeft_Click(object sender, EventArgs e)
- {
- withinTimer.Interval = intIntervalRequired;
- if (!withinTimer.Enabled)
- {
- rtxt_WordBuilder.Text += "*";
- withinTimer.Start();
- }
- else
- {
- string lastChar = "";
- // Gets the last character
- if (rtxt_WordBuilder.Text.Length > 0)
- {
- lastChar = rtxt_WordBuilder.Text.Substring(rtxt_WordBuilder.Text.Length - 1, 1);
- }
- // Deletes the last character
- rtxt_WordBuilder.Text = rtxt_WordBuilder.Text.Substring(0, rtxt_WordBuilder.Text.Length - 1);
- // reset timer
- withinTimer.Stop();
- withinTimer.Start();
- // depending on last char, pick new one
- switch (lastChar)
- {
- case "*":
- rtxt_WordBuilder.Text += "-";
- break;
- case "-":
- rtxt_WordBuilder.Text += "_";
- break;
- case "_":
- rtxt_WordBuilder.Text += "*";
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement