?
Solved

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

Posted on 2006-07-20
4
Medium Priority
?
349 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 500 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

770 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