Drawing Nodes Graphics Paint C#

123 Views Asked by At

EDIT: How do I activate scrollbars and maintain my drawing after scrolling, like Paint application. As you can see I'm drawing a circle with 25px radius, outside the client rectangle, but I can't scroll.

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 Nodes
{
    public partial class Form1 : Form
    {
        
        public Form1()
        {
            InitializeComponent();
            this.DoubleBuffered = true;
            this.AutoScroll = true;
        }

        private void Form1_Paint(object sender, PaintEventArgs e)
        {
            Graphics g = e.Graphics;
            g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
            g.DrawEllipse(Pens.Black, new Rectangle(0,this.ClientRectangle.Bottom, 50,50));
        }


    }
}
0

There are 0 best solutions below