Hi!!!
I am making a window application in which there is a textbox in which we have to enter only numeric values...
How can I display a table on the form which has columns - ones,tens,hundred ,thousand,ten thousand,lakh , ten lakh etc. Now whatever number we enter in textbox that number should automatically get filled in this numeration table ....
For example , number entered is 2589,then in table 9 should be in ones column , 8 in tens, 5 in hundreds, 2 in thousands column................
How can I create this numeration table for number entered in textbox
Loading

Kirtan PatelRank #292 · 8.6K reputationPosted Aug 10, 2009, 4:33 AM EDT
private void btnAddNumber_Click(object sender, EventArgs e) { string[] ManyNumbers = txtNumber.Text.Trim().Split(','); dataGridView1.Rows.Clear(); foreach (string str in ManyNumbers) { char[] Number = str.ToCharArray(); int Length = Number.Length; if (Number.Length int columnsCount = dataGridView1.Columns.Count - 1; for (int i = Number.Length - 1; i >= 0; i--) { int count = dataGridView1.Rows.Count - 1; dataGridView1.Rows[count].Cells[columnsCount].Value = Number[i]; columnsCount--; } } } }Kirtan PatelRank #292 · 8.6K reputationPosted Aug 10, 2009, 3:34 AM EDT
Here I Taken dataGridView to Display your table representation on made 6 Columns to add Number Digits .
i also included Project Files if you don't understand Download Link is at bottom of Post
namespace WindowsFormsApplication27 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void btnAddNumber_Click(object sender, EventArgs e) { char[] Number = txtNumber.Text.Trim().ToCharArray(); int Length = Number.Length; if (Number.Length int columnsCount = dataGridView1.Columns.Count - 1; for (int i = Number.Length - 1; i >= 0; i--) { int count = dataGridView1.Rows.Count - 1; dataGridView1.Rows[count].Cells[columnsCount].Value = Number[i]; columnsCount--; } } } } }Happy Coding :)
vinni jain109 reputationPosted Aug 10, 2009, 4:12 AM EDT
But how will this code work when value are entered in textbox separated by comma like "25447,5698,25,48,97,33,25,1,5,7,........"
vinni jain109 reputationPosted Aug 10, 2009, 8:59 AM EDT