I want to add an option to my windows form application (written in vb.net) that will give the user the option to hide the menu bar and the title bar. I can do the menu but i'm not sure what the best way is to hide the title.
I could just change the FormBorderStyle to none, but is that the best way of doing it?
Cheers Luke
By default, title bars are shown on the windows in the page. To hide the title bar, right-click any empty space on the menu bar.
From the Window menu, select Title Bar, then select Normal, Small, or Hidden.
You can hide the taskbar both in desktop mode and tablet mode. Press and hold or right-click any empty space on the taskbar, select Taskbar settings, select Taskbar behaviors, and select Automatically hide the taskbar.
Actually you can hide the title bar during runtime (i found a way to do this), by hiding the form before you change the borderstyle to 0(/none) and then show it back again. I used a checkbox to toggle it from 0 to 1/2/3/4/5. AND it works even if it has a value in TEXT property.
I just found an easier solution that is working great for me during runtime. This question was posted a long time ago, but maybe somebody else will find this helpful.
The eureka for me was learning to set the form's ControlBox property to false. Note too that the text property must be empty.
Dim f As New Form
f.Text = String.Empty
f.ControlBox = False
f.Show(Me)
From this page, to do it at writing time:
form1.borderstyle = 0 (None), 1 (Fixed Single), 2 (Sizeable), 3 (Fixed Dialog), 4 (Fixed Toolwindow), 5 (Sizeable Toolwindow)
However, to turn on/off at runtime is much harder, see the reasoning and the example of how to do so Here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With