开发者

In VB6, how do I have a program open at a specific pixel-based resolution?

开发者 https://www.devze.com 2022-12-12 10:44 出处:网络
I need my vb6 application to open to a precise dime开发者_运维知识库nsions, in pixels.How do I do this?Use the Height and Width properties of your forms.Since the unit of measure for these properties

I need my vb6 application to open to a precise dime开发者_运维知识库nsions, in pixels. How do I do this?


Use the Height and Width properties of your forms. Since the unit of measure for these properties is twips, you need to convert pixels to twips. For this you can use the Screen,TwipsPerPixelX and Screen,TwipsPerPixelY proeprties.

Do something like this in Form_Load:

Me.Width = formWidthPixels * Screen.TwipsPerPixelX
Me.Height = formHeightPixels * Screen.TwipsPerPixelX

Where formWidthPixels and formHeightPixels are the width and height in pixels you want your forms.

0

精彩评论

暂无评论...
验证码 换一张
取 消