screen keyword - vb.net

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

My current vb code having screen keyword. can anyone tell me what is the
equalent in vb.net?

frm.Top = (Screen.Height - frm.Height) / 2
frm.Left = (Screen.Width - frm.Width) / 2

thanks
bala
 
Bala said:
My current vb code having screen keyword. can anyone tell me what is the
equalent in vb.net?

frm.Top = (Screen.Height - frm.Height) / 2
frm.Left = (Screen.Width - frm.Width) / 2

Monitor size:

'SystemInformation.PrimaryMonitorSize'
'SystemInformation.WorkingArea'
'SystemInformation.VirtualScreen'
'Screen.PrimaryScreen.Bounds'
'Screen.PrimaryScreen.WorkingArea'

When using multiple monitors:

'Screen.AllScreens'
 
Try this

frm.Top = (Screen.PrimaryScreen.WorkingArea.Height - frm.Height) / 2
frm.Left = (Screen.PrimaryScreen.WorkingArea.Width - frm.Width) / 2

HTH
 
Thank you so much to all.

Bala

Herfried K. Wagner said:
Monitor size:

'SystemInformation.PrimaryMonitorSize'
'SystemInformation.WorkingArea'
'SystemInformation.VirtualScreen'
'Screen.PrimaryScreen.Bounds'
'Screen.PrimaryScreen.WorkingArea'

When using multiple monitors:

'Screen.AllScreens'
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top