Point décimal à la calculatrice en c#

AHHHHH ok c'est me rend fou.

Pourquoi quand ma virgule au mauvais endroit par exemple

si j'ai la chaîne 567 dans la zone de texte et cliquez sur le décimal bouton je m'attends (ou je veux) la zone de texte pour modifier à 567. mais au lieu de cela je obtenir .567

Il ne va dans le bon endroit quand j'ai ajouter un autre numéro, par exemple, si j'avais le numéro 4, puis tout de suite après faire la dessus j'aimerais obtenir 567.4

Edit:

Voilà mon code entier:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace Calculator
{
public partial class frmCurrencyCalc : Form
{
public frmCurrencyCalc()
{
InitializeComponent();
}
private void cmdZero_Click(object sender, EventArgs e)
{
if (txtScreen.Text == "0")
{
txtScreen.Text = "0";
}
else
{
txtScreen.AppendText("0");
}
}
private void cmd1_Click(object sender, EventArgs e)
{
if (txtScreen.Text == "0")
{
txtScreen.Text = "1";
}
else
{
txtScreen.AppendText("1");
}
}
private void cmdTwo_Click(object sender, EventArgs e)
{
if (txtScreen.Text == "0")
{
txtScreen.Text = "2";
}
else
{
txtScreen.AppendText("2");
}
}
private void cmdThree_Click(object sender, EventArgs e)
{
if (txtScreen.Text == "0")
{
txtScreen.Text = "3";
}
else
{
txtScreen.AppendText("3");
}
}
private void cmdFour_Click(object sender, EventArgs e)
{
if (txtScreen.Text == "0")
{
txtScreen.Text = "4";
}
else
{
txtScreen.AppendText("4");
}
}
private void cmdFive_Click(object sender, EventArgs e)
{
if (txtScreen.Text == "0")
{
txtScreen.Text = "5";
}
else
{
txtScreen.AppendText("5");
}
}
private void cmdSix_Click(object sender, EventArgs e)
{
if (txtScreen.Text == "0")
{
txtScreen.Text = "6";
}
else
{
txtScreen.AppendText("6");
}
}
private void cmdSeven_Click(object sender, EventArgs e)
{
if (txtScreen.Text == "0")
{
txtScreen.Text = "7";
}
else
{
txtScreen.AppendText("7");
}
}
private void cmdEight_Click(object sender, EventArgs e)
{
if (txtScreen.Text == "0")
{
txtScreen.Text = "8";
}
else
{
txtScreen.AppendText("8");
}
}
private void cmdNine_Click(object sender, EventArgs e)
{
if (txtScreen.Text == "0")
{
txtScreen.Text = "9";
}
else
{
txtScreen.AppendText("9");
}
}
private void cmdDecimal_Click(object sender, EventArgs e)
{
txtScreen.AppendText(".");
cmdDecimal.Enabled = false;
}
private void cmdCancel_Click(object sender, EventArgs e)
{
txtScreen.Text = "0";
cmdDecimal.Enabled = true;
}
}
}
Nous ne pouvons pas dire ce que txtScreen est.
ses une zone de texte. Imaginez une calculatrice. Le txtScreen est l'écran d'affichage
ce code n'est qu'un morceau de mon code entier
J'ai écrit un petit exemple d'application pour tester cela et ne semble pas possible de reproduire ce que vous décrivez. Est-il autre chose qui manque? Êtes-vous de faire quelque chose avec laquelle le point d'insertion est dans votre code?
ma zone de texte est aligné à droite à gauche ne fait que changer.

OriginalL'auteur Pops | 2010-02-22