none
Create an application in Visual Basic that runs in full screen.

    Question

  • Hello!

    My name is Orens Xhagolli and I am a between Beginner-Intermediate level. I am trying to create a little game with nice-looking and good options in Visual Basic.net. A good game needs to run in full screen. (Because the new directX is not suitable for my age (13) I don't want to use it and beacuse its a bit difficult to use it.) I read a few answers in MSDN forums but the full screen there doesn't take the entire screen ( The taskbar is visible ).

    If you can help me, please do it. This would mean very much for me.

    If you can help me with DirectX codes that works with DirectX SDK March 2009 for Visual Basic would be another good thing.
    Monday, June 22, 2009 9:25 PM

Answers

All replies

  • I just searched this forum and found this thread.  I tested it and it works...the taskbar does not show.  Look at the VB code in the reply marked as the Answer:

    http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/ae6f5d32-03d7-4e75-ae22-0104a2dfd5b6/


        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load  
            Me.Size = SystemInformation.PrimaryMonitorSize  
            Me.Location = New Point(0, 0)  
            Me.TopMost = True 
        End Sub
    

    Try it in a test project.  Set the FormBorderStyle to None.  Add a button to the form and set its anchor property to Top, Left, Right, Bottom and in the Button click event just type END so that you can stop the program.


    Doug

    SEARCH ... then ask
    • Proposed as answer by ShariqDON Friday, October 02, 2009 6:41 AM
    Monday, June 22, 2009 9:51 PM
  • .NET would not be any less difficult, as both use the same interfaces. (DirectX is mostly COM, which works the same way as .NET classes do.)

    I understand what you want, which is often referred to as full screen exclusive mode. That's possible, but...let me try to figure out a simple way to do that in .NET so that you can get to the part that interests you.

    If I understand you correctly, then you might want to check out DarkBASIC Professional, since it allows you to get that effect simply by placing a check mark in your project's settings before compiling the program. (Very nice feature!) Plus, it already uses Dire4ctX without you needing to implement the interface.

    Try this link to see what is available at The Game Creators.
    http://www.thegamecreators.com

    Monday, June 22, 2009 9:52 PM
  • try this

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Me.Size = New Size(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height)
    
            Me.Location = New Point(0, 0)
        End Sub
    • Proposed as answer by ShariqDON Friday, October 02, 2009 6:42 AM
    Monday, June 22, 2009 9:57 PM
  • Oh, even easier than that!  Just set these 3 properties:


    'Demonstrated in the Form_Load event:

     

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

     

        Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None

     

        Me.TopMost = True

     

        Me.WindowState = FormWindowState.Maximized

     

    End Sub

    Monday, June 22, 2009 10:06 PM
  • Hello!

    My name is Orens Xhagolli and I am a between Beginner-Intermediate level. I am trying to create a little game with nice-looking and good options in Visual Basic.net. A good game needs to run in full screen. (Because the new directX is not suitable for my age (13) I don't want to use it and beacuse its a bit difficult to use it.) I read a few answers in MSDN forums but the full screen there doesn't take the entire screen ( The taskbar is visible ).

    If you can help me, please do it. This would mean very much for me.

    If you can help me with DirectX codes that works with DirectX SDK March 2009 for Visual Basic would be another good thing.

    Hi Orens Xhagolli,


    Try MAXIMIZE with the FormBorderStyle as NONE like this.>>

    Option Strict On
    
    Public Class Form1
    
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    
            'Mamimized window.>>
            Me.WindowState = FormWindowState.Maximized
            'No FORM border.>>
            Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None
    
        End Sub
    
    End Class
    


    Regards,

    John

    Monday, June 22, 2009 10:13 PM
  • Hi Orens Xhagolli,

    Besides the great suggestions provided by the folks above, you may also want to consider how your game is going to behave if the target machine has more than one monitors connected, and the desktop area is expanded to all monitors (instead of duplicated display).

    Another thing you might be interested in: the Windows API Code Pack for .NET Framework, which exposes portions of DirectX API to the .NET Framework.

    For game development, another choice would be the XNA Game Studio, check it out.

    Have fun programming! :)
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Send us any feedback you have about the help from MSFT at fbmsdn@microsoft.com.

    The CodeFx Project
    My Blog (in Simplified Chinese)
    Tuesday, June 23, 2009 10:07 AM
    Moderator
  • If you are interested for a very good full screen I found a very good full screen code.  I tried and it is very very good:

    Public Class Form1
        Private Sub Form1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Click
            End
        End Sub
    
        Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            Dim fs As New FullscreenClass
    
            fs.FullScreen(Me, True)
        End Sub
    End Class
    
    Public Class FullscreenClass
        Public Declare Function SetWindowPos Lib "user32.dll" Alias "SetWindowPos" (ByVal hWnd As IntPtr, ByVal hWndIntertAfter As IntPtr, ByVal X As Integer, ByVal Y As Integer, ByVal cx As Integer, ByVal cy As Integer, ByVal uFlags As Integer) As Boolean
    
        Private Declare Function GetSystemMetrics Lib "user32.dll" Alias "GetSystemMetrics" (ByVal Which As Integer) As Integer
    
        Private Const SM_CXSCREEN As Integer = 0
        Private Const SM_CYSCREEN As Integer = 1
        Public Shared HWND_TOP As IntPtr = IntPtr.Zero
        Public Const SWP_SHOWWINDOW As Integer = 64
    
        Public ReadOnly Property ScreenX() As Integer
            Get
                Return GetSystemMetrics(SM_CXSCREEN)
            End Get
        End Property
    
        Public ReadOnly Property ScreenY() As Integer
            Get
                Return GetSystemMetrics(SM_CYSCREEN)
            End Get
        End Property
    
        Public Sub FullScreen(ByVal frm As Form, ByVal boolTopOptional As Boolean)
            frm.WindowState = FormWindowState.Maximized
            frm.FormBorderStyle = Windows.Forms.FormBorderStyle.None
            frm.TopMost = boolTopOptional
            SetWindowPos(frm.Handle, HWND_TOP, 0, 0, ScreenX, ScreenY, SWP_SHOWWINDOW)
        End Sub
    End Class
    
    Tuesday, June 23, 2009 12:16 PM
  • If you are interested for a very good full screen I found a very good full screen code.  I tried and it is very very good:
    Interesting indeed.

    Two comments:

    1. The SystemInformation.PrimaryMonitorSize property is the .NET equivalent of the GetSystemMetrics function with SM_CXSCREEN and SM_CYSCREEN.

    2. The Form.BringToFront method is the .NET equivalent of the SetWindowPos function with HWND_TOP.

    Regards,

    Jie
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Send us any feedback you have about the help from MSFT at fbmsdn@microsoft.com.

    The CodeFx Project
    My Blog (in Simplified Chinese)
    • Marked as answer by DeletedName Wednesday, June 24, 2009 10:36 AM
    Wednesday, June 24, 2009 8:28 AM
    Moderator
  • You can also do the following, during FormLoad:

    Me.TopMost = True
    Me.ControlBox = False
    Me.WindowState = FormWindowState.Maximized
    Friday, October 02, 2009 6:33 AM
  • Asalam,

    Dear just set The properties of form

    • Click On Form Properties
    • Click on Border style
    • Set on "NONE"

    Shah_group1@yahoo.com

    Saturday, June 02, 2012 10:06 PM