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;
using System.Timers();
namespace WindowsForms
{
public partial class Form1 : Form
{
int circleDiameter;
public Form1()
{
InitializeComponent();
circleDiameter = 100;
}
private void Form1_Paint(object sender, PaintEventArgs e)
{
Point CenterPoint = new Point()
{
X = this.ClientRectangle.Width / 2,
Y = this.ClientRectangle.Height / 2
};
Point topLeft = new Point()
{
X = (this.ClientRectangle.Width - circleDiameter) / 2,
Y = (this.ClientRectangle.Height - circleDiameter) / 2
};
Point topRight = new Point()
{
X = (this.ClientRectangle.Width + circleDiameter) / 2,
Y = (this.ClientRectangle.Height - circleDiameter) / 2
};
Point bottomLeft = new Point()
{
X = (this.ClientRectangle.Width - circleDiameter) / 2,
Y = (this.ClientRectangle.Height + circleDiameter) / 2
};
Point bottomRight = new Point()
{
X = (this.ClientRectangle.Width + circleDiameter) / 2,
Y = (this.ClientRectangle.Height + circleDiameter) / 2
};
e.Graphics.DrawEllipse(Pens.Red, topLeft.X, topLeft.Y, circleDiameter, circleDiameter);
e.Graphics.DrawLine(Pens.Red, CenterPoint, topLeft);
}
private void timer1_Tick(object sender, EventArgs e)
{
}
}
}