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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:24:15+00:00 2026-06-17T09:24:15+00:00

Hi i am trying to learn windows presentation foundation WPF and was trying to

  • 0

Hi i am trying to learn windows presentation foundation WPF and was trying to develop the simplest application Calculator. But i am having issue in displaying the ‘-‘ when i substract a higher value from smaller. For eg. if i do something like this “10 – 20” the output should be “-10” in the screen i.e. textbox. But it is displaying “10-“. Somehow the ‘-‘ is coming in the end. my xaml code for textbox looks like following:

    <TextBox Height="33" HorizontalAlignment="Left" Name="outputbox" 
             VerticalAlignment="Top" Width="278" 
             FontFamily="Tahoma" FontSize="18" 
             FlowDirection="righttoleft" IsReadOnly="True" />

and the code for doing substraction and display looks something like this

      if (entry1 > entry2)
      {
        outputbox.Text = (entry1 - entry2).ToString();
      }
      else 
      {
        outputbox.Text = "-" + (entry2 - entry1).ToString();
      }

while debugging it shows the proper string as “-10” but while displaying in the textbox it is showing the string “10-“. Any idea about what is missing???

  • 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-17T09:24:16+00:00Added an answer on June 17, 2026 at 9:24 am

    Just remove the FlowDirection attribute from your TextBox and your result will be fine.

    <TextBox Height="33" 
             HorizontalAlignment="Left" 
             Name="outputbox" VerticalAlignment="Top" 
             Width="278" 
             FontFamily="Tahoma" 
             FontSize="18"  IsReadOnly="True" />
    

    Or you may specify FlowDirection="LeftToRight" which is the default for the TextBox

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

Sidebar

Related Questions

I've always worked with Windows Forms, but now I'm trying to learn WPF due
I'm trying to learn .NET and WPF, and I'm making a calculator type application
I'm trying to learn Windows 8 metro style app development but every time I
I am trying to learn the Windows API. Currently I am having a lot
I'm trying to learn how to create an application on Windows Phone 8. I
I'm trying to learn WPF (I worked a lot with WinForms but I'm kinda
I'm trying to ditch Windows Forms, and learn to use WPF professionally from now
I am trying to learn TDD, but getting RSpec + Autotest setup on Windows
I am trying to learn WPF.. Although, Im having trouble with the layouts and
I'm trying to learn Roslyn by building an existing but simple application from 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.