WEB开发网
开发学院图形图像Flash Silverlight(6) - 2.0控件之ScrollViewer, Slider... 阅读

Silverlight(6) - 2.0控件之ScrollViewer, Slider, StackPanel, TabControl, TextBlock, TextBox, ToggleButton

 2008-11-14 11:50:44 来源:WEB开发网   
核心提示: Slider.xaml.csusing System;using System.Collections.Generic;using System.Linq;using System.Net;using System.Windows;using System.Windows.Controls

Slider.xaml.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 Silverlight20.Control
{
  public partial class Slider : UserControl
  {
    public Slider()
    {
      InitializeComponent();
    }
  
    private void Slider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
    {
      // RoutedPropertyChangedEventArgs<double>.OldValue - Slider控件的原值
      // RoutedPropertyChangedEventArgs<double>.NewValue - Slider控件的新值
  
      lblMsg.Text = string.Format("原值:{0}rn新值:{1}", e.OldValue.ToString(), e.NewValue.ToString());
    }
  }
}

3、StackPanel.xaml

<UserControl x:Class="Silverlight20.Control.StackPanel"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  <StackPanel HorizontalAlignment="Left">
  
    <!--
    Orientation - StackPanel控件内对象的排列方向
      Horizontal - 水平排列
      Vertical - 垂直排列
    -->
    <StackPanel Orientation="Horizontal">
      <TextBlock Text="a" Margin="5" />
      <TextBlock Text="b" Margin="5" />
      <TextBlock Text="c" Margin="5" />
    </StackPanel>
    
    <StackPanel Orientation="Vertical">
      <TextBlock Text="a" Margin="5" />
      <TextBlock Text="b" Margin="5" />
      <TextBlock Text="c" Margin="5" />
    </StackPanel>
    
  </StackPanel>
</UserControl>

上一页  1 2 3 4 5 6 7  下一页

Tags:Silverlight 控件 ScrollViewer

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接