Oppure

Loading
30/01/11 11:13
visualrenzo
Adessogarzie all' aiuto di Poeo85 sono andato un po' avanti,
Ho scritto questo:

Dim qqh, qqw, ht, ll As Integer
Dim ml_DimHeight As Long
Dim ml_DimWidth As Long

Private Sub Form_Load()
Form1.Height = Screen.Height '* 0.9
Form1.Width = Screen.Width '* 0.9

ml_DimHeight = Screen.Height '* 0.9
ml_DimWidth = Screen.Width '* 0.9

Image1.Width = 945
Image1.Height = 1155
Image2.Width = 945
Image2.Height = 1155
Image3.Width = 945
Image3.Height = 1155
Image4.Width = 945
Image4.Height = 1155


End Sub

Private Sub Form_Resize()

'image 2
If ml_DimHeight > 0 Then
Image1.Height = Image1.Height * (Form1.Height / ml_DimHeight)
Image2.Height = Image2.Height * (Form1.Height / ml_DimHeight)
Image3.Height = Image3.Height * (Form1.Height / ml_DimHeight)
Image4.Height = Image4.Height * (Form1.Height / ml_DimHeight)
End If
If ml_DimWidth > 0 Then
Image1.Width = Image1.Width * (Form1.Width / ml_DimWidth)
Image2.Width = Image2.Width * (Form1.Width / ml_DimWidth)
Image3.Width = Image3.Width * (Form1.Width / ml_DimWidth)
Image4.Width = Image4.Width * (Form1.Width / ml_DimWidth)

End If



Image1.Left = 0
Image1.Top = 0

Image2.Left = 0
Image2.Top = ml_DimHeight - Image2.Height + 100

Image3.Left = ml_DimWidth - Image3.Height + 100
Image3.Top = 0

Image4.Left = ml_DimWidth - Image4.Height
Image4.Top = ml_DimHeight - Image4.Width



ml_DimHeight = Form1.Height
ml_DimWidth = Form1.Width
end sub

Vorrei che ridimensionando il form le 4 immaggini mi rimangono sempre ai 4 vertici del form ridimensionandosi sempre in %.
Sembra funzionare la 1° in alto a sx le altre un po' meno.

Dove sbaglio ?
aaa
30/01/11 19:42
poeo85
buona sera...allora mi sembra da una prima occhiata che
1_ hai fatto qualche errore con il width e height

2_ anche se di poco o pochissimo le variabili globali contengono le dimensione del form che sono maggiori rispetto la dimensione reale.


dovrebbe esser così
Image1.Left = 0
Image1.Top = 0

Image2.Left = 0
Image2.Top = Form1.Height - Image2.Height + 100

Image3.Left = Form1.Width - Image3.Width + 100
Image3.Top = 0

Image4.Left = Form1.Width - Image4.Width
Image4.Top = Form1.Height - Image4.Height


domani controllo meglio...spero cmq che sia stato utile :asd:
Ultima modifica effettuata da poeo85 31/01/11 12:03
aaa