Berikut Code cara tambahkan separator di textbox
Fungsi :
public string Separator(string sNominal)
{
double temp = 0;
string FormatCcy = "#,##0";
try
{
temp = double.Parse(sNominal.Trim().Replace(",", ""));
}
catch (Exception)
{
}
return temp.ToString(FormatCcy);
}
Cara Pengunaan :
Tambahkan event di textbox (TextChanged) dengan code :
private void txtQty_TextChanged(object sender, EventArgs e)
{
if (txtQty.Text.Trim() != "")
{
txtQty.Text = Separator(txtQty.Text);
txtQty.Select(txtQty.Text.Length, 1);
}
}
ConversionConversion EmoticonEmoticon