C
C#2mo ago
João Paulo

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
ero
ero2mo ago
Please show what you mean
João Paulo
João PauloOP2mo ago
Ok
ero
ero2mo ago
Please show what you mean by "it moves a little to the side"
João Paulo
João PauloOP2mo ago
João Paulo
João PauloOP2mo ago
Done
this_is_pain
this_is_pain2mo ago
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
João Paulo
João PauloOP2mo ago
adjusted border size, nothing changed
Mayor McCheese
Mayor McCheese2mo ago
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.
João Paulo
João PauloOP2mo ago
Solved. button.GotFocus += RemoveFocus; private void RemoveFocus(object sender, EventArgs e) { this.ActiveControl = null; }

Did you find this page helpful?