question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Form blocked in minimized state

See original GitHub issue

Hello,

Back to share a new strange and very annoying bug.

How to reproduce :

  • Just compile MaterialSkinExample project
  • Go in bin folder and run as administrator MaterialSkinExample.exe
  • Application is displaying
  • Click in taskbar on the app to minimize it
  • Click in task on the app to show it again

And here is the issue, the window will never come back to normal state It is only happening when you launch your app in admin, it is very important to reproduce the case.

For now all verification, checks, and investigation gave me nothing. A colleague had also a look on it without more result.

The only thing that I know is that’s probably an issue with the TabControl component. I’m not able to reproduce it on MaterialSkinExample project but on the project on which I’m working when I’ve removed the line this.DrawerTabControl = this.materialTabControl; in Main.Designer.cs it was making minimize/normal state change working again.

image image

Running on Win10 64bits

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:2
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
muzsorcommented, Aug 17, 2021

Here is a piece of code that worked for me, I think this is not a great solution.

// Form.cs
private const int WM_ACTIVATEAPP = 0x001C;

protected override void WndProc(ref Message m)
{
    base.WndProc(ref m);
    if (WindowState == FormWindowState.Minimized && m.Msg == WM_ACTIVATEAPP && m.WParam == IntPtr.Zero)
    {
        BringToFront();
    }
}

Running on .Net Framework 4.7.2 Win10 1903

1reaction
leocbcommented, Mar 25, 2020

Hi, thanks for reporting, you keep surprising me with these bug reports hahah

Probably not a problem with the tabControl, but with how I handle the Drawer (hamburguer menu) with 2 extras forms. I’ve never seen administrator rights causing weird behavior in the interface messages.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Maximize Form from Minimized State not working
When I try to Maximize a Form when it is in a Minimized state, (I am using Windows Form) It will not open....
Read more >
Form stuck in minimized state while loop running?
There is no need to do more, this simple code shows exactly the problem i'm facing, while my loop is running, once I...
Read more >
Resolved - Prevent a form from being minimized
You can shadow the WindowState property and prevent the Minimized state being set.
Read more >
PersistenceBehavior - A minimized form state is restored ...
PersistenceBehavior - A minimized form state is restored when the form is being loaded. Hi, I did some testing with the PersistenceBehavior and ......
Read more >
Main form is minimized after child form closing
Hi, We have problem with main form that is minimized after child form closing: 1.Click the button (child form appears) 2.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found