Strange Label behavior

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can someone explain this one to me ...?
Add one Label and one Button to form .
Set RightToLeft of Label to True.
try this
Label1.Text="12345.";
on display you will see
..12345
the decimal jumped to the wrong side

if you then do this
Label1.Text = Label1.Text + "00";
on screen you will see
12345.00
it corrected itself
huh?
Thanks in advance
 
Hi,

I cannot reproduce this. Could you give us a code sample demonstrating
the error? Is the position of the controls important. What kind of
Visual Studio (if any) are you using?
 
I"m using vs 2005
i"m using c#
private void button1_Click(object sender, EventArgs e)
{
label1.Text = "12345.";
}
THIS WILL REPRODUCE IT
the label on screen will show
.12345
this will only happen if RightToLeft is True

thanx a mill for your time!
 
Sorry, I still can't reproduce it. Using a Label, AutoSize true or false,
LeftToRight Yes or No. When setting the text during button click it
always displays "12345." with . at the end.

Does this happen in new projects or just one or a few?
 
SLIMSHIM said:
I"m using vs 2005
i"m using c#
private void button1_Click(object sender, EventArgs e)
{
label1.Text = "12345.";
}
THIS WILL REPRODUCE IT
the label on screen will show
.12345
this will only happen if RightToLeft is True

Could you give a short but *complete* program demonstrating the
problem?
See http://www.pobox.com/~skeet/csharp/complete.html for what I mean by
that.

Jon
 
I started anew project .
I added one label
I changed the properties of the label as such..
autosize = Fals
RightToLeft = Yes
this is my actual code...

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
label1.Text = "12345.";
}
}
}
 
SLIMSHIM said:
I started anew project .
I added one label
I changed the properties of the label as such..
autosize = Fals
RightToLeft = Yes
I added a Button
and this is the code for the click event...
 
SLIMSHIM said:
I started anew project .
I added one label
I changed the properties of the label as such..
autosize = Fals
RightToLeft = Yes
this is my actual code...

<snip>

What I could do with is the *entire* code - without any need to setup a
project, click anywhere, etc. Something I can cut and paste into a .cs
file and compile. That way we're all *sure* we're talking about the
same code.

Jon
 
I"m using vs 2005
i"m using c#
private void button1_Click(object sender, EventArgs e)
{
label1.Text = "12345.";
}
THIS WILL REPRODUCE IT
the label on screen will show
.12345
this will only happen if RightToLeft is True


What language version is your operating system? Is it actually a RTL
system?


Mattias
 
Hi,

'partial class' means this is only part of the code for the class. You
need to post the designer code as well (Form1.Designer.cs), and remember
to show all the designer generated code normally hidden inside a region.
 
Sorry for taking so long to get back.

I realized that mattias is correct in that what I realy needed was to right
justify
the text. RighttoLeft is realy only for languages like
hebrew that work backwards.

Never The Less...
there is nothing special to my code. This was done in a brand new project.
I think the dot has some internal special significance. Any other Character
does not coase this strange behavior..

Thank all of you again for your help
You Guys are the reason humanity still survives!
(willing to give your time and effort to someone you don't know)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top