| While ... Wend |
| |
| |
| Private Sub Command1_Click() | |
| Dim i%, k% | |
| |
| Command1.Visible = False | |
| |
| For i = Me.Height To Screen.Height | Formular öffnet sich proportional zur Bildschirmgröße |
| Me.Height = i | von links oben nach rechts unten. |
| Me.Width = i * (Screen.Width / Screen.Height) | |
| Next i | |
| |
| With Label1 | Ein Label wird initialisiert. |
| .Top = Screen.Height - (Label1.Height * 2) | |
| .Left = 0 | |
| .Width = 1000 | |
| .Height = 400 | |
| .BackColor = RGB(0, 0, 255) | |
| End With | |
| |
| While k <= Me.Width | Label soll sich horizontal bis zur Formulargröße von links |
| With Label1 | nach rechts vergrößern. |
| .Width = k * (Me.Width / Me.Height) + 1 | |
| End With | |
| k = k + 1 | |
| Wend | |
| End Sub | |
| |
| Private Sub Form_Load() | |
| Me.Top = 0 | Position des Formulars nach Laden: linke obere |
| Me.Left = 0 | Bildschirmecke. |
| End Sub | |
| |
| |
| ' Alternativen mit Prozentrechnung | |
| ' Für das Öffnen des Formulars: | |
| ' Dim maxh As Long, maxb As Long, i As Long | |
| ' maxh = Screen.Height | |
| ' maxb = Screen.Width | |
| ' For i = 1 To 100 | |
| ' Me.Height = (maxh / 100) * i | |
| ' Me.Width = (maxb / 100) * i | |
| ' Next i | |
| |
| ' Für die Erweiterung des Labels: | |
| ' While i < Form1.ScaleWidth | |
| ' Label1.Width = Label1.Width + 1 ' oder Label1.Width = i | |
| ' i = i + 1 | |
| ' Wend | |
| |