1
Visual Basic 6 / Re:Autoajustar Imagen de un CommandButton evento resize
« en: Abril 20, 2015, 11:17:27 am »
PODRIAS HACERLO ASI, TOMO COMO REFERENCIA LA RESPUESTA ANTERIOR
Private Sub Form_Load()
HScr = Screen.Width / Screen.TwipsPerPixelX
VScr = Screen.Height / Screen.TwipsPerPixelY
VFactor = VScr / 750
HFactor = HScr / 1000
'Factor = HScr / 800
NoCambiar = True
Me.Width = Me.Width * HFactor
Me.Height = Me.Height * VFactor
NoCambiar = False
End Sub
Private Sub Form_Resize()
Dim ctl As Control
On Error Resume Next
If NoCambiar Then Exit Sub
For Each ctl In Form1
ctl.Top = ctl.Top * VFactor
ctl.Height = ctl.Height * VFactor
ctl.Left = ctl.Left * HFactor
ctl.Width = ctl.Width * HFactor
ctl.FontSize = ctl.FontSize * VFactor
If ctl.Picture Then
IMAGE3.Move 0, 0, ctl.Width * 0.6, ctl.Height * 0.6
IMAGE3.Picture = LoadPicture("")
IMAGE3.Refresh
IMAGE3.PaintPicture ctl.Picture, 0, 0, ctl.Width * 0.6, ctl.Height * 0.6
ctl.Picture = IMAGE3.Image
End If
Next
NoCambiar = True
End Sub
Private Sub Form_Load()
HScr = Screen.Width / Screen.TwipsPerPixelX
VScr = Screen.Height / Screen.TwipsPerPixelY
VFactor = VScr / 750
HFactor = HScr / 1000
'Factor = HScr / 800
NoCambiar = True
Me.Width = Me.Width * HFactor
Me.Height = Me.Height * VFactor
NoCambiar = False
End Sub
Private Sub Form_Resize()
Dim ctl As Control
On Error Resume Next
If NoCambiar Then Exit Sub
For Each ctl In Form1
ctl.Top = ctl.Top * VFactor
ctl.Height = ctl.Height * VFactor
ctl.Left = ctl.Left * HFactor
ctl.Width = ctl.Width * HFactor
ctl.FontSize = ctl.FontSize * VFactor
If ctl.Picture Then
IMAGE3.Move 0, 0, ctl.Width * 0.6, ctl.Height * 0.6
IMAGE3.Picture = LoadPicture("")
IMAGE3.Refresh
IMAGE3.PaintPicture ctl.Picture, 0, 0, ctl.Width * 0.6, ctl.Height * 0.6
ctl.Picture = IMAGE3.Image
End If
Next
NoCambiar = True
End Sub