c# - Maximising borderless form covers task bar only when maximised from a normal size -
i using c# give application 'fullscreen mode' using borderless form , maximise method. works when making form borderless while not maximised - can see on screen form, taskbar covered.. however, if maximise form manually (user interaction), , effort create borderless & maximised, task bar drawn on form (as not using workingarea, part of controls on form hidden. intended behaviour not show taskbar). tried setting form's property topmost true, doesn't seem have effect.
is there way rework cover taskbar?
if (this.formborderstyle != system.windows.forms.formborderstyle.none) { this.formborderstyle = system.windows.forms.formborderstyle.none; } else { this.formborderstyle = system.windows.forms.formborderstyle.sizable; } if (this.windowstate != formwindowstate.maximized) { this.windowstate = formwindowstate.maximized; } else { if (this.formborderstyle == system.windows.forms.formborderstyle.sizable) this.windowstate=formwindowstate.normal; }
however, if maximise form manually (user interaction)...
the issue window internally marked beingness in maximized state. maximizing again not alter current size of form. leave taskbar exposed. you'll need restore first normal, maximized. yes, flickers bit.
private void togglestatebutton_click(object sender, eventargs e) { if (this.formborderstyle == formborderstyle.none) { this.formborderstyle = formborderstyle.sizable; this.windowstate = formwindowstate.normal; } else { this.formborderstyle = formborderstyle.none; if (this.windowstate == formwindowstate.maximized) this.windowstate = formwindowstate.normal; this.windowstate = formwindowstate.maximized; } }
c# winforms forms
No comments:
Post a Comment