Skip to content

Control size documentations #2881

@Descolada

Description

@Descolada

Firstly, Control.GetPreferredSize()

public SizeF GetPreferredSize() => GetPreferredSize(SizeF.PositiveInfinity);
) is undocumented.

I'm also having issues with the Control.Size property: before the form is shown it always reports (1, 1) even if I assign to it and then immediately read the property. However, once the form is shown the size I assigned to it will take effect. Likely this is not a bug and should just be documented: I'm assuming Size saves the desired size internally but reports the actual size (which is (1,1) until the form is shown) until it takes effect. I'm testing with Eto.Forms GTK.
Side-note: personally I'd prefer the sentinel value to be (-1, -1) and if the user has assigned an explicit size, then that. Of course only before the control has been shown, and real size afterwards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions