Live-Forum - Die aktuellen Beiträge
Anzeige
Archiv - Navigation
764to768
Aktuelles Verzeichnis
Verzeichnis Index
Übersicht Verzeichnisse
Vorheriger Thread
Rückwärts Blättern
Nächster Thread
Vorwärts blättern
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
764to768
764to768
Aktuelles Verzeichnis
Verzeichnis Index
Verzeichnis Index
Übersicht Verzeichnisse
Inhaltsverzeichnis

Command-Button optimal anordnen

Command-Button optimal anordnen
16.05.2006 09:09:39
gert
Hallo Excel-Experten,
ich möchte gerne die Command-Button so anordnen, dass diese je nach Bildschirmauflösung zentriert, mit gleichem Abstand angezeigt werden.
Dies funktioniert an meinem PC mit Auflösung 1280 x 1024, jedoch nicht
an meinem Laptop. Dort sind die Buttons nach rechts verschoben
Auflösung 800 x 600)
Was muss ich tun damit es auch dort funktioniert?
Gibt es eine Möglichkeit die gesamte Breite zu berechnen?
Nachfolgenden Code habe ich bisher genutzt:
With Me
.Width = Application.Width
.Height = Application.Height
.Label204.Top = 40
.Label204.Left = Application.Width * 0.5 - Application.Width * 0.3
.CommandButton3.Top = .Height - .CommandButton3.Height - 50
.CommandButton3.Left = 100
.CommandButton7.Top = .CommandButton3.Top
.CommandButton7.Left = .CommandButton3.Left + .CommandButton3.Width + 16
.CommandButton6.Top = .CommandButton3.Top
.CommandButton6.Left = .CommandButton7.Left + .CommandButton7.Width + 16
.CommandButton4.Top = .CommandButton3.Top
.CommandButton4.Left = .CommandButton6.Left + .CommandButton6.Width + 16
.CommandButton5.Top = .CommandButton3.Top
.CommandButton5.Left = .CommandButton4.Left + .CommandButton4.Width + 16
End With
Für die Hilfe danke ich im Voraus
Viele Grüsse
Gert

3
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
AW: Command-Button optimal anordnen
16.05.2006 10:14:34
u_
Hallo,
dann musst du halt die Pos. des 1.CMD berechnen und nich absolut festlegen.

Private Sub UserForm_Initialize()
Dim iTop As Integer, iLeft As Integer
With Me
.Width = Application.Width
.Height = Application.Height
iTop = .Height - .CommandButton3.Height - 50
iLeft = (.Width - CommandButton3.Width - CommandButton4.Width - CommandButton5.Width - CommandButton6.Width - CommandButton7.Width - 64) / 2
.Label204.Top = 40
.Label204.Left = Application.Width * 0.5 - Application.Width * 0.3
.CommandButton3.Top = iTop
.CommandButton3.Left = iLeft
.CommandButton7.Top = iTop
.CommandButton7.Left = .CommandButton3.Left + .CommandButton3.Width + 16
.CommandButton6.Top = iTop
.CommandButton6.Left = .CommandButton7.Left + .CommandButton7.Width + 16
.CommandButton4.Top = iTop
.CommandButton4.Left = .CommandButton6.Left + .CommandButton6.Width + 16
.CommandButton5.Top = iTop
.CommandButton5.Left = .CommandButton4.Left + .CommandButton4.Width + 16
End With
End Sub

Gruß
Geist ist geil!
(Dies ist ein allgemeines Statement und nicht an bestimmte Personen gerichtet.)
Anzeige
AW: Command-Button optimal anordnen
16.05.2006 18:22:10
gert
Hallo U,
das Geist geil ist habe ich nicht bezweifelt.
Könnte ich mein Problem lösen, würde ich mich nicht ans Forum wenden.
Könnest Du mir trotzdem Dein Geist auf mein Problem ausschütten?
Danke im Voraus
Viele Grüsse
Gert
AW: Command-Button optimal anordnen
16.05.2006 21:06:53
u_
Hallo,
hab ich doch! Mal den Code probiert?
Gruß
Geist ist geil!
(Dies ist ein allgemeines Statement und nicht an bestimmte Personen gerichtet)

Links zu Excel-Dialogen

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige