·  Start ·  Programme ·  Codes ·  Tipps ·  ActiveX ·  Tutorials · 



Eine Listbox kann abwechselnd links- und rechtsbündig gefüllt werden...
Sie brauchen eine Form und eine Listbox.

Private Declare Function GetSystemMetrics Lib "user32" _
    (ByVal nIndex As Long) As Long

Private Sub AddRightAlignText(mControl As ListBox, strText As String)
  Dim m_CheckWidth As Long
    If mControl.Style = 1 Then
        m_CheckWidth = ((GetSystemMetrics(71) + 2) * 15)
    End If
        strText = Space((mControl.Width - TextWidth(strText) - 100 _
        - m_CheckWidth) / TextWidth(Space(1))) & strText
    mControl.AddItem strText
End Sub

Private Sub Form_Load()
    With List1
        .AddItem "Linksbündig"
        Call AddRightAlignText(List1, "Rechtsbündig")
        .AddItem "Und wieder links"
        Call AddRightAlignText(List1, "Rechtsbündig")
        .AddItem "Und nochmal rechts"
    End With
End Sub
Aktualisiert: 12.02.2008, 14:10 Uhr Copyright © 2001 - 2010 by ST-software Navigation zurück  |  Navigation vorwärts  |  Zum Seitenanfang     
Ihre IP: 38.107.191.84 ·  Seite erstellt in: 0.007 Sekunden ·  Dateigröße:  2797 Bytes