Solved

.ScaleWidth is not the same as converting .Width to pixels

Posted on 2006-07-20
4
344 Views
Last Modified: 2010-04-30
Can anyone explain the following:

?Me.ScaleMode = vbPixels
True
?Me.ScaleWidth
 289
?Me.Width / Screen.TwipsPerPixelX
 297

Why are the two 'widths in pixels' not the same?
0
Comment
Question by:FartingUncle
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 26

Accepted Solution

by:
EDDYKT earned 125 total points
ID: 17147384
scalewidth if the width without including the border of your form
0
 
LVL 1

Author Comment

by:FartingUncle
ID: 17147441
OK - so therefore, to set the form's interior width to 200px I should use the following:

Me.Width = ((Me.Width / Screen.TwipsPerPixelX) - Me.ScaleWidth + 200) * Screen.TwipsPerPixelX
0
 
LVL 13

Expert Comment

by:Mark_FreeSoftware
ID: 17149863
yes
0
 
LVL 1

Author Comment

by:FartingUncle
ID: 17150443
Good - Thank you.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question