Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[SWF] Button.PreferredSize returns wrong value #13440

@gthzrsfk

Description

@gthzrsfk
using System;
using System.Windows.Forms;
using System.Drawing;

class Form1 : Form {
    static void Main() {
        Application.Run(new Form1());
    }
    public Form1() {
        var button = new Button {
            Text = "test",
            Parent = this,
        };
        Console.WriteLine(button.PreferredSize);
        button.Size = Size.Empty;
        Console.WriteLine(button.PreferredSize);
    }
}

Current Behavior

Output on Linux

{Width=75, Height=23}
{Width=0, Height=0}

Expected Behavior

Output on Windows

{Width=75, Height=24}
{Width=35, Height=24}

On which platforms did you notice this

[ ] macOS
[x] Linux
[ ] Windows

Version Used:

Mono JIT compiler version 5.18.0.268 (tarball Thu Feb 28 15:29:06 UTC 2019)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
Misc: softdebug
Interpreter: yes
LLVM: yes(600)
Suspend: preemptive
GC: sgen (concurrent by default)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions