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 FirstSilverlightApplication{ public partial class MainPage : UserControl { public MainPage() { InitializeComponent(); } private voID ListBox1_SelectionChanged(object sender,SelectionChangedEventArgs e) { ListBoxItem theItem = ListBox1.SelectedItem as ListBoxItem; textBox1.Text = theItem.Content.ToString(); } }}
<UserControl x:Class="FirstSilverlightApplication.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" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"> <GrID x:name="LayoutRoot" Background="White"> <ListBox Height="154" HorizontalAlignment="left" margin="59,12,0" name="ListBox1" VerticalAlignment="top" WIDth="239" ItemsSource="{Binding}" SelectionChanged="ListBox1_SelectionChanged"> <ListBoxItem Content="List1" /> <ListBoxItem Content="List2" /> <ListBoxItem Content="List3" /> </ListBox> <TextBox Height="23" HorizontalAlignment="left" margin="59,192,0" name="textBox1" VerticalAlignment="top" WIDth="239" /> </GrID></UserControl>总结
以上是内存溢出为你收集整理的Silverlight4入门之listbox控件(六)全部内容,希望文章能够帮你解决Silverlight4入门之listbox控件(六)所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)