I am having a issue with getting my Win form app to go into fullscreen - Well sort of.
See if you exit after you enter then enter again it works just fine - But when you go into it the first time it sitll shows some of the taskbar.
(See below)
Code:
Private Sub ToolStripButton5_Click(sender As Object, e As EventArgs) Handles ToolStripButton5.Click, FullScreenToolStripMenuItem.Click
ToolStripButton5.Visible = False
ControlBox = False
Me.WindowState = FormWindowState.Maximized
Me.Size = SystemInformation.PrimaryMonitorSize
Me.WindowState = 2
Me.Location = New Point(0, 0)
Me.TopMost = True
Me.FormBorderStyle = 0
Me.TopMost = True
ToolStripButton6.Visible = True
End Sub
'Exit FullScreen.
Private Sub ToolStripButton6_Click_1(sender As Object, e As EventArgs) Handles ToolStripButton6.Click, ExitFullScreenToolStripMenuItem.Click
Me.WindowState = FormWindowState.Normal
Me.Size = MaximumSize
Me.FormBorderStyle = FormBorderStyle.Sizable
ToolStripButton5.Visible = True
ControlBox = True
Me.TopMost = False
ToolStripButton6.Visible = False
End Sub
When you first load the application and every time - you have to go into - back out and back into fullscreen just for it to be right.
The code took me a few months to come up with. This being is because there is no native "Form.GoFullScreen"
Wished it was that easy - Sure there is a way for me to write a class maybe but rather not for now.
The code really isn't that hard to understand...But I just don't understand why it isn't working when I hit fullscreen the first time...
Updated the second screenshot to display fullscreen better
Last edited by jdc20181; Nov 10th, 2016 at 06:30 PM.
Disclaimer: When code is given for example - it is merely a example. •
•
•
Unless said otherwise indicated - All Code snippets advice or otherwise that I post on this site, are expressly licensed under Creative Commons Attribution 4.0 International Please respect my copyrights.
P.S. I know the stip menu overlaps Not really worried thats going away soon
Disclaimer: When code is given for example - it is merely a example. •
•
•
Unless said otherwise indicated - All Code snippets advice or otherwise that I post on this site, are expressly licensed under Creative Commons Attribution 4.0 International Please respect my copyrights.
Why do you even have this line? What is '2'? You will actively have to put that number in, and remove a specific enumeration....
Originally Posted by jdc20181
...
Code:
...
Me.WindowState = 2
...
...
To maximize your application just make the form maximized: you don't need to mess with the forms size or border.
Me.WindowState = FormWindowState.Maximized
"Ok, my response to that is pending a Google search" - Bucky Katt. "There are two types of people in the world: Those who can extrapolate from incomplete data sets." - Unk. "Before you can 'think outside the box' you need to understand where the box is."
Since you are processing things in an event handler for a control that you are manipulating, that might be an issue, I don't know.
I would try to do the control manipulation outside the control's event handler.
So, put the code into a sub, and then invoke the sub asynchronously to see if that helps.
For instance, create a sub named makeFullScreen and put the code in there.
In the event handler asynchronously Invoke the sub by using BeginInvoke:
Me.BeginInvoke( makeFullScreen)
That way your code will have left the event handler for the toolstrip before trying to hide the toolstrip.
Since the toolstrip would want to draw the button pressed in the up state when you release the button, but you've also told it to hide itself during the event, you've created a paradox for the code. Things you've told the form or controls to do that change their appearance don't happen while you're in your code. They happen later when the window gets the messages you've caused by calling those methods, or setting those properties.
Even doing the code outside the event may not guarantee the hiding and drawing don't conflict, but at least gives it a good chance to work, first time.
Last edited by passel; Nov 11th, 2016 at 09:08 AM.
Ah I see. Well, you can still use maximized and border style none.
However...
Changing the border style of a form can cause funky things to happen, in VS2005 it was terrible, and caused events to loose their handlers. In 2010, it's better but can cause some errors (I can easily generate stack overflow errors when changing a form border style).
I believe changing the style causes the window handle to be recreated (thinking back to the C++ days), but could be wrong.
"Ok, my response to that is pending a Google search" - Bucky Katt. "There are two types of people in the world: Those who can extrapolate from incomplete data sets." - Unk. "Before you can 'think outside the box' you need to understand where the box is."
If this is something that is designed to run "kiosk mode", he can change all the window settings design-time. I've written a number of programs designed to be full-screen dominant, hiding the fact that there's even an operating system running underneath, or an easy way to access it. For things like shop-floor control systems, message-boards being displayed on large, airport style displays, and kiosks, this is just an everyday thing. passel pretty much nailed everything that needs to be done for the basics. Disabling, or making it hard to access the underlying operating system is trickier.
Since you are processing things in an event handler for a control that you are manipulating, that might be an issue, I don't know.
I would try to do the control manipulation outside the control's event handler.
So, put the code into a sub, and then invoke the sub asynchronously to see if that helps.
For instance, create a sub named makeFullScreen and put the code in there.
In the event handler asynchronously Invoke the sub by using BeginInvoke:
Me.BeginInvoke( makeFullScreen)
That way your code will have left the event handler for the toolstrip before trying to hide the toolstrip.
Since the toolstrip would want to draw the button pressed in the up state when you release the button, but you've also told it to hide itself
Yep that is the goal - to make it "Fullscreen" by doing what I did it hides the task bar (But the issue is it doesn't do it the first time around)
Originally Posted by SJWhiteley
Ah I see. Well, you can still use maximized and border style none.
However...
Changing the border style of a form can cause funky things to happen, in VS2005 it was terrible, and caused events to loose their handlers. In 2010, it's better but can cause some errors (I can easily generate stack overflow errors when changing a form border style).
I believe changing the style causes the window handle to be recreated (thinking back to the C++ days), but could be wrong.
The code hides the task bar because there is no Me.GoFullScreen() Function - So The code is different than what you have been describing.
Originally Posted by Jenner
If this is something that is designed to run "kiosk mode", he can change all the window settings design-time. I've written a number of programs designed to be full-screen dominant, hiding the fact that there's even an operating system running underneath, or an easy way to access it. For things like shop-floor control systems, message-boards being displayed on large, airport style displays, and kiosks, this is just an everyday thing. passel pretty much nailed everything that needs to be done for the basics. Disabling, or making it hard to access the underlying operating system is trickier.
Kisok mode? I have no clue what that is - The project is my browser project. It is a function that all major browsers have.
If y'all wanna see what it does you can always download it and try it yourself : http://beffsbrowser.tk
The screenshots made the demo - so you don't need to download but - if you wish ^ there is teh website - Currently in version 1.6.0
Thanks.
I am gonna try The suggestion passel said.
And seeing what the reduced code does.
However -
The code should make the taskbar disappear. With the taskbar it isn't fullscreen.
Thanks again.
Disclaimer: When code is given for example - it is merely a example. •
•
•
Unless said otherwise indicated - All Code snippets advice or otherwise that I post on this site, are expressly licensed under Creative Commons Attribution 4.0 International Please respect my copyrights.
Why do you even have this line? What is '2'? You will actively have to put that number in, and remove a specific enumeration....
To maximize your application just make the form maximized: you don't need to mess with the forms size or border.
Me.WindowState = FormWindowState.Maximized
I think this is a older method to make the screen max (Not liek fullscreen max but max size or something) But not certain - I tried googling to get a good answer but I honestly have no clue. This is a bug I am trying to patch up - Written a while ago.
Last edited by jdc20181; Nov 11th, 2016 at 11:25 AM.
Disclaimer: When code is given for example - it is merely a example. •
•
•
Unless said otherwise indicated - All Code snippets advice or otherwise that I post on this site, are expressly licensed under Creative Commons Attribution 4.0 International Please respect my copyrights.
Disclaimer: When code is given for example - it is merely a example. •
•
•
Unless said otherwise indicated - All Code snippets advice or otherwise that I post on this site, are expressly licensed under Creative Commons Attribution 4.0 International Please respect my copyrights.
Well good news is the menu stip isn't overlapped anymore (Thanks so much!) Bad news is I can't seem to get it to do it the first time Still.
Disclaimer: When code is given for example - it is merely a example. •
•
•
Unless said otherwise indicated - All Code snippets advice or otherwise that I post on this site, are expressly licensed under Creative Commons Attribution 4.0 International Please respect my copyrights.
I've done this, as well, for a splash screen like form that had to behave a bit differently than a real splash screen. I had the settings in design mode rather than in code, so I didn't do the Size or Location, but it's still about the same.
I've done this, as well, for a splash screen like form that had to behave a bit differently than a real splash screen. I had the settings in design mode rather than in code, so I didn't do the Size or Location, but it's still about the same.
I used the code - And it fixed the overlap of the menu strip (which is great)
but idk how to invoke it - Because of what I said in post 10...
Disclaimer: When code is given for example - it is merely a example. •
•
•
Unless said otherwise indicated - All Code snippets advice or otherwise that I post on this site, are expressly licensed under Creative Commons Attribution 4.0 International Please respect my copyrights.
I don't know that I can offer anything more at this point. I can't look at your links, or any of the images you posted as they are blocked from my work. If I remember, I'll look at them some hours from now so I can see what you're referring to.
odd they are blocked....That is the screenshot program I use ScreenShooter. They save only easy peasy...But that is appreciated -
Disclaimer: When code is given for example - it is merely a example. •
•
•
Unless said otherwise indicated - All Code snippets advice or otherwise that I post on this site, are expressly licensed under Creative Commons Attribution 4.0 International Please respect my copyrights.
Generally, big business is assuming that file and photo sharing sites are not business related, so doesn't allow access without getting a waiver. Just one of those facts of life, which is one reason posting an image on this forum would be preferred, and it will probably have a longer access, and be more immediate in any case. But large screen captures are discourages, as they will be reduced when posted so can be impossible to read if too large an area is captured.
I am using VS 2013 (cause 15 won't install it was being dumb) hopefully this will still work.
I really appreciate you taking the time to do this
Thanks!!
Disclaimer: When code is given for example - it is merely a example. •
•
•
Unless said otherwise indicated - All Code snippets advice or otherwise that I post on this site, are expressly licensed under Creative Commons Attribution 4.0 International Please respect my copyrights.
It does still work but I don't understand how you came up with "NormalMode" theres no code for it...Like there is for make fullscreen.
Disclaimer: When code is given for example - it is merely a example. •
•
•
Unless said otherwise indicated - All Code snippets advice or otherwise that I post on this site, are expressly licensed under Creative Commons Attribution 4.0 International Please respect my copyrights.
So - What do I need to make it fully functioning in my project migrating the essentials?
From what I can tell (Just recomfirm and I will be marking this resolved)
- I need the code in the Form Extensions (For the sake of NormalMode.)
- The MakeFullScreen Sub code.
Will the "MakeFullScreen" code be enough?
Thanks again (just trying to understand your code I am still learning even though I have been programming for nearly 2 years)
Disclaimer: When code is given for example - it is merely a example. •
•
•
Unless said otherwise indicated - All Code snippets advice or otherwise that I post on this site, are expressly licensed under Creative Commons Attribution 4.0 International Please respect my copyrights.
Edit: I think I got it working just fine now, again Thanks for your help. I am always trying to learn. I have had many people use my browser so making it the best quality I can for my user base is important.
Thanks!
Disclaimer: When code is given for example - it is merely a example. •
•
•
Unless said otherwise indicated - All Code snippets advice or otherwise that I post on this site, are expressly licensed under Creative Commons Attribution 4.0 International Please respect my copyrights.
Ok so I changed the code from what i had to normalmode() but it still hides the task bar when I Exit fullscreen....
Disclaimer: When code is given for example - it is merely a example. •
•
•
Unless said otherwise indicated - All Code snippets advice or otherwise that I post on this site, are expressly licensed under Creative Commons Attribution 4.0 International Please respect my copyrights.