Author Topic: Removing the title bar  (Read 1624 times)

CptHook

  • Newbie
  • *
  • Posts: 3
    • View Profile
Removing the title bar
« on: June 28, 2016, 12:15:13 PM »
Does anyone know if there is a way to remove the title bar?

I've put the HMI on a tablet and am looking to make it more difficult for the user to get outside of the screen that I have set up.

Thanks!
-Steve

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Removing the title bar
« Reply #1 on: June 28, 2016, 03:36:34 PM »
- Click on a blank area of your form
- In the Properties Window, change FormBorderStyle to None

You may also want to set WindowsState to Maximized. Those settings will not allow you to exit the application unless you use Alt-F4 on a keyboard or with Task manager. There is a trick I use to exit for updates. I leave the AdvancedHMI logo PictureBox on the form, then setup a double click to exit like this:

- Right click on a blank area of the form and select View Code
- Enter this code:
Code: [Select]
    Private Sub PictureBox1_DoubleClick(sender As Object, e As EventArgs) Handles PictureBox1.DoubleClick
        Close()
    End Sub

CptHook

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Removing the title bar
« Reply #2 on: June 28, 2016, 04:11:33 PM »
This is great. Thanks!

Is there a way to use your Picture Box trick open a different form? I like the close concept, but was hoping I could use it to bring it back to a menu selection.

Thanks for the help!
-Steve

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Removing the title bar
« Reply #3 on: June 28, 2016, 04:13:44 PM »
In the ToolBox, there is a FormChangeImage

Or like the code above, instead of using "Close()", you could use something like Page2.Show


CptHook

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Removing the title bar
« Reply #4 on: June 28, 2016, 05:19:03 PM »
Perfect! Thanks!!

-Steve