我使用下面的代码:如何在VB6中检测我的显示器分辨率?
Private Sub Form_Load()
ResWidth = Screen.Width \ Screen.TwipsPerPixelX
ResHeight = Screen.Height \ Screen.TwipsPerPixelY
ScreenRes = ResWidth & "x" & ResHeight
MsgBox (ScreenRes)
End Sub
而且我GOOGLE了其他几个类似的代码。问题是,我总是收到一个消息框,说我的分辨率是1200x1200,尽管我的实际分辨率是1920x1200。为什么我会得到不好的结果?
添加screen.width,screen.height,twipsperpixelx,和你的消息框twipsperpixely值,您能得到什么? – jac 2010-08-22 05:04:25
在我的系统上正常工作!好奇的问题.... – Dabblernl 2010-08-22 20:24:01
我认为这应该工作,它看起来很好。系统有什么不寻常之处吗? – MarkJ 2010-08-23 08:17:52