C
C#2y ago
Livid

✅ Winforms

i have a button with Anchor = AnchorStyles.Bottom | AnchorStyles.Right, property but even though it's the only control in the form it just appears in the top left
10 Replies
Livid
LividOP2y ago
No description
SWR
SWR2y ago
Anchor style will change how your button resizes with your window. If that's not what you want, try looking at the Dock property
Livid
LividOP2y ago
but dock can have only one value not like bottom & right
Pobiega
Pobiega2y ago
Move it to where you want it (ie, lower right corner), then set the anchor prop to Bottom | Right
Pobiega
Pobiega2y ago
Pobiega
Pobiega2y ago
this button is manually placed with the desired distance from the corner, then anchored to bottom | right, no docking
Livid
LividOP2y ago
so i could just do that and like Left = form.width - btn.Width Top = form.Height - btn.Height as startup
Pobiega
Pobiega2y ago
Yep, that could work
Livid
LividOP2y ago
hmm i wish there was a better way :(
Pobiega
Pobiega2y ago
Winforms isnt really designed for "flow" layouts as such, you might want to consider WPF if you want that experience

Did you find this page helpful?