Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: anchor or similar? #523

Closed
gusmanb opened this issue Jun 9, 2016 · 2 comments
Closed

Question: anchor or similar? #523

gusmanb opened this issue Jun 9, 2016 · 2 comments

Comments

@gusmanb
Copy link

gusmanb commented Jun 9, 2016

Hi.

I'm starting to test Eto.Forms and I didn't found any documentation about it, is there any type of mechanism to auto adapt layouts to window size? something like Anchor and Dock on WinForms, or any way to specify sizes in percentages?

Cheers.

@blahlicus
Copy link

Hey late to the party but I thought this would be useful to others that stumbled into this thread,

An effect similar to WinForms Anchor could be done via the use of TableLayout and the ScaleHeight / ScaleWidth properties.

This code sample over here are two forms demonstrating how to create effects that are similar to the Dock Filled option and Dock Left option in WinForms.

I was also struggling to understand TableLayouts when I first made contact with it (from Qt), I think Curtis did a really great job explaining TableLayouts (or at least Eto's implementation of the TableLayout which is basically ported from Gtk) from this Eto wiki page.

@cwensley
Copy link
Member

cwensley commented Oct 7, 2016

Hopefully that has answered the questions, @gusmanb. There is no anchor, but dock is pretty much default for all containers.

To 'anchor', you place the control(s) in the appropriate cells in a TableLayout, so they can be either to the left or right with ScaleWidth as false. Note that you must have at least one cell with ScaleWidth = true, so you'd have to add a cell between the left and right in order for empty space to appear between them.

Hope this helps!
Curtis.

@cwensley cwensley closed this as completed Oct 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants