472,122 Members | 1,451 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,122 software developers and data experts.

a Picture Box question

Anyone can tell me how to make sure
that the width of a picture box would
become 100 pixels width if i do use the
autosize true

because the width is like 2055 for a
100 pixel width how to convert that?

Thank you all
Jul 17 '05 #1
3 7189
when I do change the ScaleWidth
the real Width does not change

Can you explain that?

"Stephane Richard" <st**************@verizon.net> wrote in message
news:Et*****************@nwrdny02.gnilink.net...
You can change the "ScaleMode" property of the picturebox to Pixels instead of the default Twips" scale.

This way if you want the picture box to be 100 you can simply set the
Picture box's width to 100 instead of that 2055 you're talking about.

--
Stéphane Richard
Senior Software and Technology Supervisor
http://www.totalweb-inc.com
For all your hosting and related needs

"Yang Li Ke" <ya******@sympatico.ca> wrote in message
news:uW*******************@news20.bellglobal.com.. .
Anyone can tell me how to make sure
that the width of a picture box would
become 100 pixels width if i do use the
autosize true

because the width is like 2055 for a
100 pixel width how to convert that?

Thank you all


Jul 17 '05 #2
Borders = Width - ScaleWidth
what do you mean by Borders ?
a picture box has no Borders

"J French" <Bo*************@iss.u-net.com_.bin> wrote in message
news:3f***************@news.btclick.com... On Tue, 1 Jul 2003 09:41:48 -0400, "Yang Li Ke"
<ya******@sympatico.ca> wrote:
when I do change the ScaleWidth
the real Width does not change

Can you explain that?


Change the Widh
Borders = Width - ScaleWidth

Jul 17 '05 #3
On Tue, 1 Jul 2003 12:19:15 -0400, "Yang Li Ke"
<ya******@sympatico.ca> wrote:
Borders = Width - ScaleWidth


what do you mean by Borders ?
a picture box has no Borders

Try it - with a PictureBox with BorderStyle set to FixedSingle

Private Sub Command1_Click()
Me.Print Picture1.Width - Picture1.ScaleWidth
End Sub

You should get 60 printed - eg: 4 pixels

Actually I was being obscure
- the ScaleWidth property is rather different from the Width property
- changing the ScaleWidth property directly changes the 'ScaleMode'
- it is like changing the ScaleMode from vbTwips to vbPixels
(like, but not exactly that - look up ScaleWidth in the Help File)

To adjust something to have a desired ScaleWidth you _must_ attack it
through the Width property
- hence

Borders = Width - ScaleWidth
or
Width = Borders + ScaleWidth

Obviously the ScaleMode must be the same ...
Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Simone Winkler | last post: by
10 posts views Thread by Chris Coho, Jr. | last post: by
4 posts views Thread by Andre Nogueira | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.