'在Picturebox大小变化时,同步拉伸里面的图片。 Private Sub Picture1_Resize() On Error Resume Next With Picture1 DoEvents .PaintPicture .Picture, 0, 0, .ScaleWidth, .ScaleHeight If Err.Number <> 0 Then Err.Clear .PaintPicture .Picture, 0, 0, .ScaleWidth, .ScaleHeight, , , , , vbSrcCopy End If End With End Sub
http://expert.csdn.net/Expert/topic/3054/3054313.xml?temp=.689541
Private Sub Picture1_Resize()
On Error Resume Next
With Picture1
DoEvents
.PaintPicture .Picture, 0, 0, .ScaleWidth, .ScaleHeight
If Err.Number <> 0 Then
Err.Clear
.PaintPicture .Picture, 0, 0, .ScaleWidth, .ScaleHeight, , , , , vbSrcCopy
End If
End With
End Sub
Prv.ScaleMode = SistemaCoordinate
Prv.width = (mm * 21) * (val(zVal.text) / 100)
Prv.Height = (mm * 29.7) * (val(zVal.text) / 100)
Prv.ScaleWidth = (mm * 21) 'frmpreprv.ScaleWidth
Prv.ScaleHeight = (mm * 29.7) 'frmpreprv.ScaleHeight
Prv.Refresh