MaterialSkin icon indicating copy to clipboard operation
MaterialSkin copied to clipboard

MaterialForm WindowState.Normal Issue

Open byungmeo opened this issue 3 years ago • 7 comments

2022-02-09 23-30-11

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

byungmeo avatar Feb 09 '22 14:02 byungmeo

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

WindowStateNormalIssueNotReproduced

valimaties avatar Feb 10 '22 06:02 valimaties

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.

byungmeo avatar Feb 10 '22 07:02 byungmeo

... 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.

valimaties avatar Feb 10 '22 08:02 valimaties

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

byungmeo avatar Feb 10 '22 09:02 byungmeo

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 🙂

valimaties avatar Feb 10 '22 09:02 valimaties

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 avatar Aug 11 '22 07:08 progmars

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);
        }

progmars avatar Aug 11 '22 16:08 progmars