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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:56:10+00:00 2026-06-13T21:56:10+00:00

I have a pretty decent background in Java and C++, but I’m struggling to

  • 0

I have a pretty decent background in Java and C++, but I’m struggling to do something trivial in C#. I have two TextBoxes: MessageBox and SenderBox. I want to send the text from SenderBox to MessageBox (which is easy), but I want to clear SenderBox once that is done. The following is basically the code that is fired when you press Enter to send the text:

string temp = SenderBox.Text;
SenderBox.Text = "cleared";
MessageBox.Text = temp;

Most programming languages are somewhat procedural or at least execute in some orderly way. Why does C#/WPF for Windows 8 apps seem to defy this standard? You would expect temp to be set equal to the value of SenderBox, first of all. If you look at the code, temp should not equal “cleared” unless that’s what SenderBox contains. At that point (line 1), it doesn’t. I tried to create a send(msg) function to dereference the weird string, but that didn’t change a thing. The following code runs as expected:

string x = "abc";
string y = x;
y = "123";
MessageBox.Text = x;

Can someone enlighten me? Not sure what’s going on here.

  • 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-06-13T21:56:11+00:00Added an answer on June 13, 2026 at 9:56 pm

    If you’re not trying to switch the contents of the two boxes, why not just do:

    MessageBox.Text = SenderBox.Text;
    SenderBox.Text = "cleared";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am pretty new to Haskell but I feel like I have a decent
I have a pretty decent understanding of Jquery but decided to dig in inside
I already have a pretty decent syntax highlighter in my Rich Edit control but
I have built a PHP calendar system and have pretty much everything done but
I'm probably totally betraying my ignorance at this point, but I have pretty much
I feel I have a pretty decent understanding of closures, how to use them,
I am using a pretty decent tutotial I have found for GCD, in it
I have a pretty decent list of the advantages of using a Rules Engine,
I have implemented what I thought was a pretty decent representation of MVC in
I have a pretty decent sized program (~1000 loc) . When i run the

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.