C
C#15mo 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
LividOP15mo ago
No description
SWR
SWR15mo 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
LividOP15mo ago
but dock can have only one value not like bottom & right
Pobiega
Pobiega15mo ago
Move it to where you want it (ie, lower right corner), then set the anchor prop to Bottom | Right
Pobiega
Pobiega15mo ago
Pobiega
Pobiega15mo ago
this button is manually placed with the desired distance from the corner, then anchored to bottom | right, no docking
Livid
LividOP15mo ago
so i could just do that and like Left = form.width - btn.Width Top = form.Height - btn.Height as startup
Pobiega
Pobiega15mo ago
Yep, that could work
Livid
LividOP15mo ago
hmm i wish there was a better way :(
Pobiega
Pobiega15mo ago
Winforms isnt really designed for "flow" layouts as such, you might want to consider WPF if you want that experience
Want results from more Discord servers?
Add your server