View difference between Paste ID: pfjkUFWm and snhzBWbT
SHOW: | | - or go back to the newest paste.
1
using System;
2
using System.Collections.Generic;
3
using System.ComponentModel;
4
using System.Data;
5
using System.Drawing;
6
using System.Linq;
7
using System.Text;
8
using System.Windows.Forms;
9
10
namespace WindowsFormsApplication1
11
{
12-
    public partial class Form3 : Form
12+
    public partial class Form4 : Form
13
    {
14-
        public Form3()
14+
        public Form4()
15
        {
16
            InitializeComponent();
17
        }
18
19
        private void button1_Click(object sender, EventArgs e)
20
        {
21-
            string str1 = textBox1.Text;
21+
            Graphics forDraw;
22-
            string[] words;
22+
            forDraw = panel1.CreateGraphics();
23-
            for (int i = 1; i<str1.Length; i++)
23+
            Pen p1 = new Pen(Color.Aqua, 9);
24-
            {
24+
            Brush b1 = Brushes.Black;
25-
            words = str1[i].Split(' ');
25+
            forDraw.DrawRectangle(p1, 100, 100, 500, 500);
26-
            }
26+
            forDraw.FillRectangle(b1, 100, 100, 500, 500);
27-
            label1.Text = Convert.ToChar(words);  
27+
        }          
28-
         }
28+
29
    }
30
}