开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜