According to the questioner himself, the problem only occurs if these two situations occur simultaneously:
- Form is configured to start maximized;
- The maximize button is disabled, i.e.:
this.MaximizeBox = false;
This is done through the IDE, which behind the scenes generates the code snippets present in the question and in this answer.
I tested and was able to reproduce the behavior in . NET 4.5, with Visual Studio 2013. Forms that don’t have the maximize button enabled, when maximized, gets behind the taskbar.
I believe that maximizing something that cannot be maximized is absurd, and forcing the user to use an application that occupies the entire screen - especially if the interface components don’t need it - should not be encouraged. My suggestion is to apply a minimum size to the form if necessary, but do nothing else with respect to size.
Could you put your code?
– Felipe Avelar
yes of course...
– Junior Guerreiro
what good is that:
CloseButtonDisabler.DisableCloseButton(this.Handle.ToInt32());
?– Rovann Linhalis
This class uses to disable the X button of the form
– Junior Guerreiro
try not to use this, and see if the error persists
– Rovann Linhalis
@Juniorguerreiro What option are you using to make the form maximized? The form is borderless?
– Jéf Bueno
So I’m already opening the maximized form, the edge is like Fixedsingle
– Junior Guerreiro
What I could notice is that if I disable the maximize button of the main form and open the maximized direct from there I have problems with the task bar, now enable the maximize of the main form and open the form without maximizing or be openit usually , maximize by the button of the form there it rethinks the taskbar.
– Junior Guerreiro
The whole problem is to disable the maximize button in the main form, I just made a test here, I left the maximize button of the main form enabled and Windowstate left to open maximized, ai sim ele respeito a barra de tarefas.
– Junior Guerreiro
Checks the property of the form "Ismdicontainer"
– MiguelJm
The code you put up has nothing to do with the problem.
– Oralista de Sistemas
before the question was more complete... the problem is not with the
WindowState
– Rovann Linhalis