ListBox 컨트롤 - ListBoxItem으로 설정된 컬렉션 컨트롤 입니다 - ItemsControl과 유하나 항목을 선택할 수 있다는 특징이 존재... |
ListBox.Xaml <UserControl x:Class="RiaListBox.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400"> <StackPanel> <ListBox x:Name="lstFavorites" Width="150" Height="150"> <ListBox.Items> <ListBoxItem> <TextBlock Text="C#" </ListBoxItem> <ListBoxItem> <TextBlock Text="ASP.NET" FontSize="20"></TextBlock> </ListBoxItem> <ListBoxItem> <TextBlock Text="J-Query" FontSize="20"></TextBlock> </ListBoxItem> <ListBoxItem> <TextBlock Text="SilverLight" FontSize="20"></TextBlock> </ListBoxItem> </ListBox.Items> </ListBox> <TextBlock x:Name="lblDisplay" FontSize="20" Width="100" </StackPanel> </UserControl> |
ListBox.Cs using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; namespace RiaListBox { public partial class MainPage : UserControl { public MainPage() { InitializeComponent(); lstFavorites.SelectionChanged += } void lstFavorites_SelectionChanged { this.lblDisplay.Text = lstFavorites.SelectedIndex]).Content).Text; } } } |
'.Net Project > SilverLight 3.0' 카테고리의 다른 글
51장 Slider 컨트롤 (0) | 2009.12.02 |
---|---|
50장 ProgressBar 컨트롤 (0) | 2009.12.02 |
48장 ComboBox 컨트롤 (0) | 2009.12.02 |
47장 RoutedEventArgs 컨트롤 (0) | 2009.12.01 |
46장 InkPresenter 컨트롤 (0) | 2009.12.01 |