wpf

listbox에서 오른쪽 정렬하고 싶을때

동동(이재동) 2017. 7. 18. 16:43

보통 기본 리스트박스로 만들면 이렇게 item 이 들어간다.


enter image description here


만약 

enter image description here


이렇게 하고 싶다면

<ListBox>
        <ListBox.ItemContainerStyle>
            <Style TargetType="ListBoxItem">
                <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
            </Style>
        </ListBox.ItemContainerStyle>
    </ListBox>


출처 : https://stackoverflow.com/questions/20934261/align-grid-column-to-right