How can the button color be changed using the method
namespace WindowsFormsApp1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } public void Chose() { this.BackColor = Color.White; } private void F03_Click(object sender, EventArgs e) { Chose(); } } } I have a lot of buttons and when you click on any one it should change color. preferably through this (it […]
How to delete drawn points from image file?
I’m reading list of points from a json file and then draw the points on a file and then display the file with the drawn points. the problem is that if before loading i wad drawing points they will stay when loading. i need to clear the image file before drawing the points form the loading json. i’m not using paint event but Graphics for drawing on the image file.
How do I get my button to work on the first click?
In Winforms I have 72 buttons with images that are supposed toggle back and forth between different images when clicked, but I can’t find why the first click doesn’t make them toggle, all clicks after the first click seem to work as expected.
How to capture a screenshot including the mouse cursor in c# winforms when drawing a point on a pictureBox?
the problem is that no matter where and when i capture the screenshot it’s capturing it without the red point or a bit after the point has drawn and then the mouse cursor is no longer at the same position.
Why when drawing points on picturebox the last point gets deleted?
private void pictureBoxPoints_MouseDown(object sender, MouseEventArgs e) { if (pictureBoxPoints.Image != null) { pointCoordinates.X = e.X; pointCoordinates.Y = e.Y; // Convert point coordinates from pictureBoxPoints to original frame coordinates double xFactor = (double)pictureBoxPoints.Image.Width / pictureBoxPoints.Width; double yFactor = (double)pictureBoxPoints.Image.Height / pictureBoxPoints.Height; double xOffset = _convertedRectangle.X; double yOffset = _convertedRectangle.Y; int imageX = (int)(pointCoordinates.X * xFactor) + […]
Why when drawing points on picturebox the last point is get deleted?
private void pictureBoxPoints_MouseDown(object sender, MouseEventArgs e) { if (pictureBoxPoints.Image != null) { pointCoordinates.X = e.X; pointCoordinates.Y = e.Y; // Convert point coordinates from pictureBoxPoints to original frame coordinates double xFactor = (double)pictureBoxPoints.Image.Width / pictureBoxPoints.Width; double yFactor = (double)pictureBoxPoints.Image.Height / pictureBoxPoints.Height; double xOffset = _convertedRectangle.X; double yOffset = _convertedRectangle.Y; int imageX = (int)(pointCoordinates.X * xFactor) + […]
Conversion failed when when converting date/time from string
Error
How do i hide all MDI children form until they are all loaded and arranged?
Here is how i add and arrange the forms based on their Tag:
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 […]
How to draw filled points circles on picturebox depending on mouse down coordinates?
first not sure if i need the paint event and second this code draw the points far on the form not in the picturebox not where i clicked with the mouse on the picturebox.