a Picture Box question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Yang Li Ke

    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


  • Yang Li Ke

    #2
    Re: a Picture Box question

    when I do change the ScaleWidth
    the real Width does not change

    Can you explain that?

    "Stephane Richard" <stephane.richa [email protected]> wrote in message
    news:EtcMa.3171 $tw3.2158@nwrdn y02.gnilink.net ...[color=blue]
    > You can change the "ScaleMode" property of the picturebox to Pixels[/color]
    instead[color=blue]
    > 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" <yanglike@sympa tico.ca> wrote in message
    > news:uW5Ma.1437 $bD1.271589@new s20.bellglobal. com...[color=green]
    > > 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
    > >
    > >[/color]
    >
    >[/color]


    Comment

    • Yang Li Ke

      #3
      Re: a Picture Box question

      [color=blue]
      > Borders = Width - ScaleWidth[/color]

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

      "J French" <Bounce_It_jerr [email protected]_.bin> wrote in message
      news:3f019e52.2 [email protected] click.com...[color=blue]
      > On Tue, 1 Jul 2003 09:41:48 -0400, "Yang Li Ke"
      > <yanglike@sympa tico.ca> wrote:
      >[color=green]
      > >when I do change the ScaleWidth
      > >the real Width does not change
      > >
      > >Can you explain that?[/color]
      >
      > Change the Widh
      > Borders = Width - ScaleWidth
      >
      >[/color]


      Comment

      • J French

        #4
        Re: a Picture Box question

        On Tue, 1 Jul 2003 12:19:15 -0400, "Yang Li Ke"
        <yanglike@sympa tico.ca> wrote:
        [color=blue]
        >[color=green]
        >> Borders = Width - ScaleWidth[/color]
        >
        >what do you mean by Borders ?
        >a picture box has no Borders
        >[/color]
        Try it - with a PictureBox with BorderStyle set to FixedSingle

        Private Sub Command1_Click( )
        Me.Print Picture1.Width - Picture1.ScaleW idth
        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 ...

        Comment

        Working...