0 Hi;
I also thought i missunderstood you, you were not very clear, anyway thanks
cheers Sbugig
0 *g* i complete missunderstood you.
Simon
0 Hey,
Thanks very much. Thats the one i was looking for. Actually somehow i never got the idea as to apply a loop and get the solution.. Thanks for the solution but do feel sorry for myself as why i cant get a simple problem.
Cheers Mate!!!!
0 Hi: I guess i got you righ if you wanted to see something like the following:- side = 5 would produce - * * * * * * * * * * * * * * * * * * * * * * * * * I've just done the following helper static void Main() { Application.Run(new Form1()); } private void button1_Click(object sender, System.EventArgs e) { int side = Int32.Parse(textBox1.Text); printSquare(side, richTextBox1); } public void printSquare (int side, RichTextBox richTxtBx) { richTxtBx.Text = ""; for (int i = 0; i < side; i ++) { for (int j = 0; j < side; j++) { richTxtBx.Text += " *"; } richTxtBx.Text += "\n"; } } if it's not what you wanted to see get back to me, i'm also new to c#
0 Hi
Do you need maybe the following:
private string BuildSquareString(int side) {
return side.ToString() + " * " + side.ToString();
}
By the way, you can use System.Text.StringBuilder to build concatanted strings.
Simon
0 Hi
I'm not sure what you want to do... is it just to sepcify the side length and print out side * side as text? The operator * is used for multiplication, and if you do side*side (side is type of int) then it calculates the numbers by multiplying.
Cheers Simon