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 6936987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:18:19+00:00 2026-05-27T12:18:19+00:00

I just recently started learning Windows Phone 7 development, C# and Silverlight. I’m making

  • 0

I just recently started learning Windows Phone 7 development, C# and Silverlight. I’m making a Morse Code Translator as an exercise but I ran into a problem. I made three buttons for the user to input morse code into a TextBox. One is for period, the second is for line and the last one is for space. The problem is that I can’t seem to input more than one character into the TextBox using this method and they simply overwrite each other.

Here’s how I tried to do it in the click event.

private void bShort_Click(object sender, RoutedEventArgs e)
{
    char dot = ".";   
    TBoxMorse2.Text = dot.ToString();
}

How should I go fixing this problem?

Sorry if this has been asked. I tried to search for it but didn’t find any similar problems here on StackOverflow.

Thank you all in advance for checking this out!

  • 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-27T12:18:20+00:00Added an answer on May 27, 2026 at 12:18 pm

    You’re explicitly overwriting the value:

    TBoxMorse2.Text = dot.ToString();
    

    By setting the property, you overwrite anything that’s already in there. You don’t want to set the property to the new value. You want to set it to the existing value plus the new value:

    TBoxMorse2.Text += dot.ToString();
    // or more explicitly, if you're not familiar with the += operator...
    TBoxMorse2.Text = TBoxMorse2.Text + dot.ToString();
    // or if you want to use string.Format,
    // since I once heard somewhere that it performs better than concatenation...
    TBoxMorse2.Text = string.Format("{0}{1}", TBoxMorse2.Text, dot.ToString());
    

    As usual, there are multiple ways to do it.

    Side note, your TBoxMorse2 variable name isn’t considered idiomatic C#. (As implied by the syntax highlighter on StackOverflow incorrectly highlighting it as a Type instead of a Variable.) C# convention prefers that variable names don’t begin with a capital letter. Something like this:

    tBoxMorse2
    // or...
    _TBoxMorse2
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just recently have started learning about the wonders of **kwargs but I've hit
I am just getting started with Silverlight and have recently added a Silverlight project
I just recently started learning RoR and found that Prototype.js is a default javascript
I've recently started learning C#. I just learned about properties and decided to make
I just recently started learning and using the ADO.NET Entity Framework and ran into
I just recently started learning the Scala language and would like to do it
I've just recently started learning HTML/CSS and I've been trying to teach myself sound
I recently started learning ruby, and I understood that you coud use code blocks
I've recently been learning python and I just started playing with networking using python's
Instead of starting to code in Matlab, I recently started learning R, mainly because

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.