1

I'm experiencing a little strange behaviour with a standard ToolStripStatusLabel, developing with C#. If I put inside a normal text like "Hello World" evrything works fine:

enter image description here

If a put an Equal character at the end, plus some other stuff different from words, like ("Hello World=--"), I've got this.

enter image description here

From the testing I made is like as ToolStripLabel make some kind of regular expression parsing or something like that, but I didn't find any doc or evidence around. I I put equals in the middle (like "Hello=World") it works fine, and prints exactly that string.

It's Odd because I was planning to write coords (like X=352,Y=43) but out of the painting area, print something like X=--,Y=--...

Code Example:

toolStripStatusLabel2.Text = "Hello World=--";
Taki
  • 17,320
  • 4
  • 26
  • 47
  • Do you use toolstrip or statusstrip? – L_J Jun 05 '18 at 08:21
  • Try `toolStripStatusLabel2.Text = @"Hello World=--";` This will escape any special characters in the string and read it as verbatim. – T_Bacon Jun 05 '18 at 08:25
  • Nope, I tried putting again RightToLeft to YES (se answer below) and adding the @ escape char, but still make the strange behaviour toolStripStatusLabel2.RightToLeft = System.Windows.Forms.RightToLeft.Yes; toolStripStatusLabel2.Text = @"Hello World=--"; Only the RightToLeft to false solved it. – Alessandro Silvestrini Jun 05 '18 at 09:27

1 Answers1

1

I can reproduce this, when I set the RightToLeft Property of Yes.

The RightToLeft property is used for international applications where the language is written from right to left, such as Hebrew or Arabic. When this property is set to RightToLeft.Yes, control elements that include text are displayed from right to left.

Can you check this property of the toolstripstatuslabel ?

  • Thank you, that actually solved. Right To Left was true, as I put it to false it worked properly. But still I don't understand why it was starting Right to Left after the equal and only with something different from words. I mean, "Hello=World" was working... "Hello World" was left to Right (even if the paarameter Right to Left was set to true). I've to study a little bit how does it parameter works. Thanks again. – Alessandro Silvestrini Jun 05 '18 at 09:21