Just starting to work with shapes in C #. Here is a small program that draws a line, and when you press a button, you should draw an oval. But for some reason does not draw.
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace Блок_схема { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button6_Click(object sender, EventArgs e) { g.DrawEllipse(new Pen(Color.Black, 5), 100, 100, 20, 50); } private void Form1_Paint(object sender, PaintEventArgs e) { Graphics g = e.Graphics; g.DrawLine(new Pen(Color.Black, 1),new Point(200, 200),new Point(200, 300)); } } }
Graphics g
toGraphics g
global variables; public Form1 () {... if it does not help, I will write a more reliable way. - Specter