关于Silverlight Fieldset Control的使用

     最开始是准备找像HTML的Fieldset的功能,可惜米有找到。如果只是外观像那样的话,其实自己做个控件,一个Textblock和rectangle就行了。随处乱找,找到这个控件,不管从界面布局上还是功能上都还不错,使用也很方便,特来分享一下。

     不过这个是第三方控件,需要加Liquid.TreeView.dll的引用。

    

<UserControl x:Class="FieldSet.Page"
    xmlns="http://schemas.microsoft.com/client/2007"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:liquidTreeView="clr-namespace:Liquid;assembly=Liquid.TreeView"
    Width="400" Height="300">
     < Canvas >
         < ScrollViewer Width ="204" Height ="250" Canvas.Left ="10" Canvas.Top ="145" >
             < StackPanel Width ="204" Orientation ="Vertical" >
                 < liquidTreeView:FieldSet x:Name ="skills" Width ="174" HorizontalAlignment ="Left" IsExpanded ="True" Text ="Your Skills" >
                     < StackPanel >
                         < CheckBox x:Name ="aiprogrammer" Content ="A.I. Programmer" TabIndex ="4" />
                         < CheckBox x:Name ="graphicsdesigner" Content ="Graphics Designer" TabIndex ="5" />
                         < CheckBox x:Name ="systemsengineer" Content ="Systems Engineer" TabIndex ="6" />
                         < CheckBox x:Name ="tester" Content ="Tester" TabIndex ="7" />
                         < CheckBox x:Name ="webdeveloper" Content ="Web Developer" TabIndex ="8" />
                     < /StackPanel >
                 < /liquidTreeView:FieldSet >
                 < liquidTreeView:FieldSet x:Name ="qualifications" Width ="174" IsEnabled ="False" HorizontalAlignment ="Left" IsExpanded ="False" Text ="Microsoft Qualifications" >
                     < StackPanel >
                         < CheckBox x:Name ="mcp" Content ="MCP" TabIndex ="10" />
                         < CheckBox x:Name ="mvp" Content ="MVP" TabIndex ="11" />
                         < CheckBox x:Name ="mcad" Content ="MCAD" TabIndex ="12" />
                         < CheckBox x:Name ="mcsd" Content ="MCSD" TabIndex ="13" />
                         < CheckBox x:Name ="otherQualification" Content ="Other" TabIndex ="14" />
                     < /StackPanel >
                 < /liquidTreeView:FieldSet >
                 < liquidTreeView:FieldSet x:Name ="interests" Width ="174" HorizontalAlignment ="Left" IsExpanded ="False" Text ="Your Interests" >
                     < StackPanel >
                         < CheckBox x:Name ="cinema" Content ="Cinema" TabIndex ="10" />
                         < CheckBox x:Name ="football" Content ="Football" TabIndex ="11" />
                         < CheckBox x:Name ="holidaying" Content ="Holidaying" TabIndex ="12" />
                         < CheckBox x:Name ="surfing" Content ="Surfing" TabIndex ="13" />
                         < CheckBox x:Name ="tv" Content ="TV" TabIndex ="14" />
                     < /StackPanel >
                 < /liquidTreeView:FieldSet >
                 < liquidTreeView:FieldSet x:Name ="years" Width ="174" HorizontalAlignment ="Left" IsExpanded ="False" Text ="Years experience?" >
                     < StackPanel >
                         < RadioButton x:Name ="sixmonths" Content ="Less Than 1 Year" Cursor ="Hand" TabIndex ="30" GroupName ="years" />
                         < RadioButton x:Name ="twoyears" Content ="Between 1 and 2 Years" Cursor ="Hand" TabIndex ="32" GroupName ="years" />
                         < RadioButton x:Name ="threeyears" Content ="More Than 2 Years" Cursor ="Hand" TabIndex ="33" GroupName ="years" />
                     < /StackPanel >
                 < /liquidTreeView:FieldSet >
             < /StackPanel >
         < /ScrollViewer >
     < /Canvas >
< /UserControl >

CS:
using System;
using System.Collections.Generic;
using System.Linq;
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 FieldSet
{
     public partial class Page : UserControl
    {
         public Page()
        {
            InitializeComponent();
        }
    }
}
效果如下:
点击下载: Liquid.TreeView.dll
需要liquid的其他DLL的可以进去这个下载地址: Liquid_5_3_2
liquid完整的demo进入这个下载地址: Liquid Controls Souce
Controls Included:
Magnifier
ColorSelector
Dropdown
Table
Scroller
MainMenu
Menu
Viewer
TextRollerBlind
TextRotatorBlind
RichTextBlock
RollerBlind
ItemViewer
FlowPanel
RichTextBox
File/Data Uploader Component
Tree View
Collapsable Fieldset
Progress Bar
Popup Dialog
Popup Bubble
Popup MessageBox
Spell Checker Component
TextBlockPlus
NumericUpDown
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值