Inserisci queste righe nel tuo codice:
codice:Private 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 Private Shared HWND_TOP As IntPtr = IntPtr.Zero Private 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 Private Sub FullScreen() Me.WindowState = FormWindowState.Maximized Me.FormBorderStyle = FormBorderStyle.None Me.TopMost = True SetWindowPos(Me.Handle, HWND_TOP, 0, 0, ScreenX, ScreenY, SWP_SHOWWINDOW) End Sub
Penso che tu voglia impostare il programma a schermo intero appena viene avviato, dunque nell'evento Form1_Load richiama la funzione:
Provato con VB.NET08 su Windows Vistacodice:Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load FullScreen() End Sub
EDIT: ho visto solo ora il post di Zlatan8., praticamente è lo stesso codice che ti ho linkato io. Ho dato per scontato che tu sapessi richiamare la funzione nell'evento in cui volevi mettere in full-screen la tua applicazione.


