Relative Content

Tag Archive for c#winforms

why in the paint it’s drawing small squares and not circles?

private void PictureBoxPoints_Paint(object sender, PaintEventArgs e) { if (pictureBoxPoints.Image != null) { Bitmap bitmap = pictureBoxPoints.Image as Bitmap; double xFactor = (double)bitmap.Width / pictureBoxPoints.Width; double yFactor = (double)bitmap.Height / pictureBoxPoints.Height; double scaleFactor = Math.Max(xFactor, yFactor); // Ensure uniform scaling foreach (System.Drawing.Point point in _dotPoints) { int ellipseSize = (int)(5 / scaleFactor); // Ensure uniform scaling […]

C# Move Controls Randomly

How can I move a Windows Forms control randomly?
By that I mean the control should move in all directions, different ankles.