leocb / MaterialSkin

Theming .NET WinForms, C# or VB.Net, to Google's Material Design Principles.
MIT License
437 stars 132 forks source link

MaterialForm WindowState.Normal Issue #335

Open byungmeo opened 2 years ago

byungmeo commented 2 years ago

2022-02-09 23-30-11

If FormBorderStyle = FixedSingle -> WindowState.Normal Method have problem.

valimaties commented 2 years ago

Sorry, but I cannot reproduce. Can you upload your test project here?

WindowStateNormalIssueNotReproduced

byungmeo commented 2 years ago

i found it! if set FormBorderStyle Attribute to FixedSingle, have same problem. i think this is my fault. I just set it up because the border of the screen was hard to distinguish. But it didn't work, and there was a bug like that just now.

valimaties commented 2 years ago

... I just set it up because the border of the screen was hard to distinguish.

Yes, indeed, I also see this as a little issue, having no border. I have this issue with border on modal forms, but I solved it by setting the main form's content as a blur content (I take a snapshot of form before displaying modal form), and in this situation the modal form is in a good visibility.

byungmeo commented 2 years ago

@valimaties That's a good idea. I'll try using it. I'm not sure, but should I close this issue?

valimaties commented 2 years ago

I think this must be somehow repaired, so, in my opinion, no, don't close it. Let's see what @orapps44 thinks about it. He is the one who maintain this project, so he is the one who must tell better than me 🙂

progmars commented 2 years ago

I have similar problem when my form grows in size every time I restore it from minimized state. I tried different FormBorderStyle - FixedDialog, Sizable, the same thing happens.

progmars commented 2 years ago

Found a fix:

        protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified)
        {
            if (DesignMode || IsDisposed)
            {
                base.SetBoundsCore(x, y, width, height, specified);
                return;
            }

            base.SetBoundsCore(RestoreBounds.Left, RestoreBounds.Top, 
                RestoreBounds.Width, RestoreBounds.Height, BoundsSpecified.All);
        }