login  Naam:   Wachtwoord: 
Registreer je!
 Forum

[VB] Fullscreen (Opgelost)

Offline junior - 31/01/2009 22:59
Avatar van juniorLid Hoi,

Weet iemand hoe ik een applicatie fullscreen moet laten openen in VB?
Dus zonder taak- en titelbalk

3 antwoorden

Gesponsorde links
Offline tomie94 - 31/01/2009 23:08 (laatste wijziging 31/01/2009 23:09)
Avatar van tomie94 PHP interesse ik weet niet of het in VB ook zo is maar in C#(met XNA) is het zo:
  1. this.graphics.IsFullScreen = true;
Offline Mario - 31/01/2009 23:09 (laatste wijziging 31/01/2009 23:17)
Avatar van Mario Crew algemeen Dit is wss wat je zoekt (paste code in je form):


  1. Public Class Form1
  2.  
  3. Private Const SM_CXSCREEN As Integer = 0
  4. Private Const SM_CYSCREEN As Integer = 1
  5. Private Shared HWND_TOP As IntPtr = IntPtr.Zero
  6. Private Const SWP_SHOWWINDOW As Integer = 64
  7.  
  8. 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
  9. Private Declare Function GetSystemMetrics Lib "user32.dll" Alias "GetSystemMetrics" (ByVal Which As Integer) As Integer
  10.  
  11.  
  12.  
  13. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  14. FullScreen()
  15. End Sub
  16.  
  17. Public ReadOnly Property ScreenX() As Integer
  18. Get
  19. Return GetSystemMetrics(SM_CXSCREEN)
  20. End Get
  21. End Property
  22.  
  23. Public ReadOnly Property ScreenY() As Integer
  24. Get
  25. Return GetSystemMetrics(SM_CYSCREEN)
  26. End Get
  27. End Property
  28.  
  29. Private Sub FullScreen()
  30. Me.WindowState = FormWindowState.Maximized
  31. Me.FormBorderStyle = FormBorderStyle.None
  32. Me.TopMost = True
  33. SetWindowPos(Me.Handle, HWND_TOP, 0, 0, ScreenX, ScreenY, SWP_SHOWWINDOW)
  34. End Sub
  35.  
  36. Public Sub NormalMode()
  37. Me.WindowState = FormWindowState.Normal
  38. Me.FormBorderStyle = FormBorderStyle.SizableToolWindow
  39. Me.TopMost = False
  40. End Sub
  41.  
  42. End Class


PS : Tommy, het equivalent in vb.net is

  1. WindowState = FormWindowState.Maximized

Maar dat zie je nog altijd je taak en titelbalk

mvg,
RedThread
Offline junior - 31/01/2009 23:19
Avatar van junior Lid Dit is idd precies wat ik zoek 
Gesponsorde links
Dit onderwerp is gesloten.
Actieve forumberichten
© 2002-2024 Sitemasters.be - Regels - Laadtijd: 0.194s