Windows Forms
When I create a simple button, and put a text align, whenever I click on it it moves a little to the side.
How can I remove this?
.NET 8, Windows Forms, Windows 10
11 Replies
Please show what you mean
Ok
Please show what you mean by "it moves a little to the side"
Done
i may be wrong but i think that's because of the appearance of the buttons
maybe touching the borders could 'adjust' this a little
adjusted border size, nothing changed
Winforms resists customizations tbh. It's great for fast trash apps, if you're concerned about look and customizing controls don't use winforms. Wpf, Maui, etc are alternatives. They're designed to be customized.
Solved.
button.GotFocus += RemoveFocus;
private void RemoveFocus(object sender, EventArgs e) {
this.ActiveControl = null;
}