Gruß!
So eine Möglichkeit gibt es. Doch leider hab ich es noch nicht 100% hinbekommen. Mit dem Code kann man seine Form an die Bildschirmauflösung anpassen und die Controls an die Form anpassen.
Modul:
Public gWidth As Integer, gHeight As Integer
Public Const SM_CXSCREEN = 0
Public Const SM_CYSCREEN = 1
Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As _
Long, ByVal dwMilliseconds As Long) As Long
Private Declare Function Beep Lib "kernel32" (ByVal dwFreq As Long, ByVal _
dwDuration As Long) As Long
Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long
Public Sub SystemMetrics(ByRef MaxWidth As Integer, ByRef MaxHeight As Integer)
MaxWidth = GetSystemMetrics(SM_CXSCREEN)
MaxHeight = GetSystemMetrics(SM_CYSCREEN)
End Sub
Public Sub Screen_Value()
SystemMetrics gWidth, gHeight
End Sub
Public Function ReturnMetrics(ByVal nIndex As Long) As Long
ReturnMetrics = GetSystemMetrics(nIndex)
End Function Form:
Dim nTop(15, 1) As Integer, nLeft(15, 1) As Integer
Dim nHeight(15, 1) As Integer, nWidth(15, 1) As Integer
Private Sub Form_Load()
Dim i As Integer
Dim b As Integer
Screen_Value
For i = 0 To 15
Set Label1(i).Container = frmCustomers 'Frame1
nTop(i, 0) = Label1(i).Top
nLeft(i, 0) = Label1(i).Left
nHeight(i, 0) = Label1(i).Height
nWidth(i, 0) = Label1(i).Width
Set Text1(i).Container = frmCustomers 'Frame1
nTop(i, 1) = Text1(i).Top
nLeft(i, 1) = Text1(i).Left
nHeight(i, 1) = Text1(i).Height
nWidth(i, 1) = Text1(i).Width
Next
For b = 0 To 2
Set Command(b).Container = frmCustomers 'Frame1
nTop(b, 0) = Command(b).Top
nLeft(b, 0) = Command(b).Left
nHeight(b, 0) = Command(b).Height
nWidth(b, 0) = Command(b).Width
Next
End Sub
Private Sub Form_Resize()
Dim HeightVal As Integer, XMultiplier As Single, YMultiplier As Single
XMultiplier = ReturnMetrics(SM_CXSCREEN) / gWidth
YMultiplier = ReturnMetrics(SM_CYSCREEN) / gHeight
On Error Resume Next
If Me.Height < 5430 Then Me.Height = 5430
If Me.Width < 6660 Then Me.Width = 6660
If gWidth = 800 And gHeight = 600 Then HeightVal = (frmCustomers.Height - _
4000) \ 16
If gWidth = 1024 And gHeight = 768 Then HeightVal = (frmCustomers.Height - _
6000) \ 16
If gWidth = 1280 And gHeight = 1024 Then HeightVal = (frmCustomers.Height - _
8000) \ 16
For i = 0 To 15
Text1(i).Width = (frmCustomers.Width - 550 - nLeft(i, 1)) * XMultiplier
Text1(i).Height = (HeightVal - 305) * YMultiplier
Text1(i).Top = (240 + HeightVal * i) * YMultiplier
Label1(i).Height = (HeightVal - 105) * YMultiplier
Label1(i).Top = (240 + HeightVal * i) * YMultiplier
Next
For b = 0 To 2
Command(b).Height = (Command(b).Height) * YMultiplier
Command(b).Top = (HeightVal) * 20
Command(b).Left = (240 + 3000 * b) * XMultiplier
Next
End Sub Aber wie gesagt..., der Code funktioniert nicht 100%!!!! Viel Erfolg!  |