hi,
I am writing a C# windows form program where on click of the button, the character values for the ascii values (A-Z) are gernerated and later displayed in a textbox.
The characters are generated.I use loop to do that but i am not able to display them in the textbox except for the letter Z. That's probably because i am not doing any sort of databinding.
Can someone help me how to do the databinding for the textbox where all the character are displayed (from A-Z) on the button click.
Thanks in advance.
MichaelPosted Sep 16, 2008, 12:23 PM
Your are overwriting textbox1.Text each time throught the loop.
Try this.
private void button1_Click(object sender, EventArgs e)
{
textbox1.Text="";
for (int i=65; i<=90; i++)
{
char c= Convert.toChar(i);
textbox1.Text+=c.toString();
}
}
anjumPosted Sep 16, 2008, 11:52 AM
here's the code..
private void button1_Click(object sender, EventArgs e)
{
for (int i=65; i<=90; i++)
{
char c= Convert.toChar(i);
textbox1.Text=c.toString();
}
}
I want All Alphabets to be displayed in the textbox1 on button1 click.
Bechir BejaouiPosted Sep 14, 2008, 9:57 AM