External ListBox style : ListBox Style « Windows Presentation Foundation « VB.Net Tutorial






<Window x:Class="ControlTemplates.MultiPartTemplates"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="MultiPartTemplate" Height="239" Width="248"
    >
  <Window.Resources>
    <ResourceDictionary>
    <ResourceDictionary.MergedDictionaries>
      
      <ResourceDictionary Source="Resources\ListBox.xaml"></ResourceDictionary>
    </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
  </Window.Resources>
    
      <ListBox Margin="5" >
        <ListBoxItem>One</ListBoxItem>
        <ListBoxItem>Two</ListBoxItem>
        <ListBoxItem>Three</ListBoxItem>
        <ListBoxItem>Four</ListBoxItem>
        <ListBoxItem>Five</ListBoxItem>
        <ListBoxItem>Six</ListBoxItem>
        <ListBoxItem>Seven</ListBoxItem>
        <ListBoxItem>Eight</ListBoxItem>
        <ListBoxItem>Nine</ListBoxItem>
        <ListBoxItem>Ten</ListBoxItem>
        <ListBoxItem>Eleven</ListBoxItem>
        <ListBoxItem>Twelve</ListBoxItem>
      </ListBox>
      
    
</Window>








16.29.ListBox Style
16.29.1.External ListBox styleExternal ListBox style
16.29.2.Define ListBox templateDefine ListBox template
16.29.3.Create a ListBoxItem, set font, content, add the ListBoxItem to the ListBoxCreate a ListBoxItem, set font, content, add the ListBoxItem to the ListBox
16.29.4.Change HeightChange Height
16.29.5.Change MinHeightChange MinHeight
16.29.6.Create a style that will produce a horizontal ListBox.Create a style that will produce a horizontal ListBox.