Re: Scalemode and picture box size VB5
- From: "Mike D Sutton" <EDais@xxxxxxxx>
- Date: Mon, 23 Jan 2006 18:35:47 -0000
> a) I have an application which uses a form and within the form a
picturebox.
> The form property 'WiindowState' on startup has been set to Maximized.
> The picturebox does not have a 'WiindowState' property so in the form load
> section I have used the following code to increase the picturebox size to
> match
> the form size:
>
> Picture1.Width = Form1.Width
> Picture1.Height = Form1.Height
> Picture1.ScaleWidth = Form1.ScaleWidth
> Picture1.ScaleHeight = Form1.ScaleHeight
>
> This does not give me the correct results, the picturebox size does not
> match the form size.
> Any ideas please????
The Width/Height properties of the form refer to the client area of the
window, what you want to do is scale the picture box to the non-client area
of the form. Try this instead:
'***
Private Sub Form_Resize()
Call Picture1.Move(0, 0, Me.ScaleWidth, Me.ScaleHeight)
End Sub
'***
> b) The following code is used to construct a rectangle from mouse
positions.
> My application requires scalemode to be set at 6 for millimetre but the
code
> only
> works correctly if scalemode is set to 1 or 3, am I missing something???
<code snipped>
When working at custom scale modes the coordinates may not evaluate to
integer coordinates, so declare your X1/Y1/X2/Y2 variables as Singles and
they will store their original position as opposed to the nearest integer.
Hope this helps,
Mike
- Microsoft Visual Basic MVP -
E-Mail: EDais@xxxxxxxx
WWW: Http://EDais.mvps.org/
.
- References:
- Scalemode and picture box size VB5
- From: Mike
- Scalemode and picture box size VB5
- Prev by Date: Scalemode and picture box size VB5
- Next by Date: Re: Visual Basic IDE Freaks Out
- Previous by thread: Scalemode and picture box size VB5
- Next by thread: Re: Visual Basic IDE Freaks Out
- Index(es):
Relevant Pages
|