center text in listview column 1

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sal21
    New Member
    • Jun 2006
    • 27

    center text in listview column 1

    Possible to center text listview column 1 ( i know to the default is left)
  • SioSio
    Contributor
    • Dec 2019
    • 272

    #2
    Code:
    ListView1.Columns(1).TextAlign = HorizontalAlignment.Center

    Comment

    • sal21
      New Member
      • Jun 2006
      • 27

      #3
      Originally posted by SioSio
      Code:
      ListView1.Columns(1).TextAlign = HorizontalAlignment.Center
      dont work!

      error in HorizontalAlign ment

      Comment

      • SioSio
        Contributor
        • Dec 2019
        • 272

        #4
        Which listview is the question about?
        In the Forms ListView, the first column is fixed to left justified.
        WFP's ListView can be centered with the following settings.
        Code:
        <ListView.ItemContainerStyle>
             <Style TargetType = "ListViewItem">
                 <Setter Property = "HorizontalContentAlignment" Value = "Stretch" />
             </ Style>
        </ ListView.ItemContainerStyle>

        Comment

        Working...