473,327 Members | 2,055 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Strange Label behavior

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

Nov 23 '06 #1
10 1611
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?
On Thu, 23 Nov 2006 02:15:01 +0100, SLIMSHIM
<SL******@discussions.microsoft.comwrote:
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


--
Happy Coding!
Morten Wennevik [C# MVP]
Nov 23 '06 #2
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!

"Morten Wennevik" wrote:
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?
On Thu, 23 Nov 2006 02:15:01 +0100, SLIMSHIM
<SL******@discussions.microsoft.comwrote:
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

--
Happy Coding!
Morten Wennevik [C# MVP]
Nov 23 '06 #3
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?

On Thu, 23 Nov 2006 09:04:01 +0100, SLIMSHIM
<SL******@discussions.microsoft.comwrote:
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!

"Morten Wennevik" wrote:
>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?
On Thu, 23 Nov 2006 02:15:01 +0100, SLIMSHIM
<SL******@discussions.microsoft.comwrote:
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

--
Happy Coding!
Morten Wennevik [C# MVP]


--
Happy Coding!
Morten Wennevik [C# MVP]
Nov 23 '06 #4
SLIMSHIM wrote:
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

Nov 23 '06 #5
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.";
}
}
}

"Jon Skeet [C# MVP]" wrote:
SLIMSHIM wrote:
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

Nov 23 '06 #6


"SLIMSHIM" wrote:
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...
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.";
}
}
}

"Jon Skeet [C# MVP]" wrote:
SLIMSHIM wrote:
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
Nov 23 '06 #7
SLIMSHIM wrote:
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

Nov 23 '06 #8
>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

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 23 '06 #9
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.

On Thu, 23 Nov 2006 16:07:02 +0100, SLIMSHIM
<SL******@discussions.microsoft.comwrote:
>

"SLIMSHIM" wrote:
>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...
>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.";
}
}
}

"Jon Skeet [C# MVP]" wrote:
SLIMSHIM wrote:
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



--
Happy Coding!
Morten Wennevik [C# MVP]
Nov 24 '06 #10
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)

"Mattias Sjögren" wrote:
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

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 24 '06 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: David Rifkind | last post by:
I've seen some strange string formatting behavior on several XP and 2000 machines. I can get the same results with Graphics.DrawString, but the easiest way to see it is to put a label on a VB or...
1
by: Itai | last post by:
I am attempting to create an ASP.NET Custom Validator javascript for a checkboxlist control. My goal is to limit the total number of selections to be 1 - 5 at most. My problem is that I get a null...
12
by: Stephen Poley | last post by:
I have a report which prints data from a parent table and two child tables (Contract and Kosten). Because it is a bit long, I suppress some fields which are often empty, based on methods found in...
1
by: anonymous | last post by:
Hello guys, I have a strange behaviour in my asp.net web page. My page contains a datagrid control, which has another nested datagrid as a user control. It works very well, when the user...
1
by: Mircea Pleteriu | last post by:
Hi, I've created a test aspnet web application which contains one page only. There is only one label control placed on the page. The text of the label control is set on server side by the...
5
by: Lucvdv | last post by:
Can anyone explain why this happens with the code at the bottom? It looked like a thread safety issue, but changing the declaration of Label1 to Shared doesn't help. Standard windows form;...
1
by: James Carters | last post by:
Back again. Despite changing the id in the form field and the corresponding 'for' in the label IE still links the generated label to the form field it was cloned from. Works in Firefox. ...
0
by: Andreas | last post by:
Hi! I'm using a custom collection with custom items to be edited with a custom CollectionEditor. This set of functionality is to be a part of a plugin for a SharpDevelop-based application. The...
2
by: Antonio | last post by:
Good morning, everyone. Here is the strange behavior: I have a datagrid (dgPIs) with paging enabled. When I click to view any page in the grid, it runs the private void lnkIPReg method,...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.