设计界面如下:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace 循环打印图案
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
/* *****
*****
*****
*****
*****
*/
private void button1_Click(object sender, EventArgs e)
{
for (int i = 0; i < 5; i++)
{
for (int j = 0; j < 5; j++)
{
textBox1.Text += "*";
}
textBox1.Text += "\r\n";
}
}
/* *
**
***
****
*****
*/
private void button2_Click(object sender, EventArgs e)
{
for (int i = 0; i < 5; i++)
{
for (int j = 0; j <= i; j++)
{
textBox2.Text += "*";
}
textBox2.Text += "\r\n";
}
}
/* *