3 Replies - 9112 Views - Last Post: 07 February 2009 - 10:35 PM Rate Topic: -----

#1 Euticus  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 23-May 08

Creating a Full Screen Form

Post icon  Posted 23 May 2008 - 09:36 PM

Friend Class Form1
	Inherits System.Windows.Forms.Form
	
	Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Integer) As Integer
	Private Const SM_CXSCREEN As Short = 0
	Private Const SM_CYSCREEN As Short = 1
	
	Private Sub Form1_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load
		Dim wid As Integer
		Dim hgt As Integer
		
		' Get the screen's size including the task bar area.
		wid = GetSystemMetrics(SM_CXSCREEN)
		hgt = GetSystemMetrics(SM_CYSCREEN)
		
		' Make the form this size.
		'UPGRADE_ISSUE: Constant vbTwips was not upgraded. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="55B59875-9A95-4B71-9D6A-7C294BF7139D"'
		'UPGRADE_ISSUE: Constant vbPixels was not upgraded. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="55B59875-9A95-4B71-9D6A-7C294BF7139D"'
		'UPGRADE_ISSUE: Form method Form1.ScaleY was not upgraded. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="CC4C7EC0-C903-48FC-ACCC-81861D12DA4A"'
		'UPGRADE_ISSUE: Form method Form1.ScaleX was not upgraded. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="CC4C7EC0-C903-48FC-ACCC-81861D12DA4A"'
		SetBounds(0, 0, VB6.TwipsToPixelsX(ScaleX(wid, vbPixels, vbTwips)), VB6.TwipsToPixelsY(ScaleY(hgt, vbPixels, vbTwips)))
	End Sub
End Class



I want my form to fill the entire screen, the code above was copied from a website. This doesn't seem to work in VB2008 express. BTW, I did "Click for more" as instructed by the upgrader, but nothing happened. Is there another way to do this?

Is This A Good Question/Topic? 0
  • +

Replies To: Creating a Full Screen Form

#2 sam_benne  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 16
  • View blog
  • Posts: 732
  • Joined: 16-January 08

Re: Creating a Full Screen Form

Posted 24 May 2008 - 01:16 PM

If you want to know about how to do this in VB2008 then go to VB.NET as people there are more likely to know how to do this.
Was This Post Helpful? 0
  • +
  • -

#3 Locke  Icon User is offline

  • Sarcasm Extraordinaire!
  • member icon

Reputation: 520
  • View blog
  • Posts: 5,596
  • Joined: 20-March 08

Re: Creating a Full Screen Form

Posted 24 May 2008 - 03:18 PM

You can do this while editing your form, you don't have to use code, and I don't know how to use code to do it, although that seems like it shpuld work.

You can edit one the WindowState property on your form, set it to maximized...and it appears maximized. You can keep it that way by setting the MaximizeBox property to false, and the restore box won't be enabled either.

This post has been edited by Locke37: 24 May 2008 - 03:19 PM

Was This Post Helpful? 0
  • +
  • -

#4 xPapeRCuTx  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 79
  • Joined: 15-January 09

Re: Creating a Full Screen Form

Posted 07 February 2009 - 10:35 PM

Friend Class Form1
	Inherits System.Windows.Forms.Form
	
	Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Integer) As Integer
	Private Const SM_CXSCREEN As Short = 0
	Private Const SM_CYSCREEN As Short = 1
	
	Private Sub Form1_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load
		Dim wid As Integer
		Dim hgt As Integer
		
		' Get the screen's size including the task bar area.
		wid = GetSystemMetrics(SM_CXSCREEN)
		hgt = GetSystemMetrics(SM_CYSCREEN)
		
	   Me.Height = hgt
	   Me.Width = wid
	End Sub
End Class

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1