Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3353912
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:12:31+00:00 2026-05-18T02:12:31+00:00

I’ve been missing the classic Fieldset of HTML in Silverlight and I couldn’t find

  • 0

I’ve been missing the classic Fieldset of HTML in Silverlight and I couldn’t find any solutions on the web. How do I go about building one?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T02:12:32+00:00Added an answer on May 18, 2026 at 2:12 am

    I figured I’ll build one.

    It’s probably not the best way to solve it but it works and I just thought I’d share it because it feels like others might be looking for the same thing.

    Simple solution though, you can set FontSize, Foreground and title of the legend.

    Markup:

    <Controls:Fieldset BorderBrush="#FFcccccc" Legend="LegendHeader" LegendFontSize="14" LegendForeground="Green">
       <Button Content="Button" />
    </Controls:Fieldset>
    

    Control Style:

    <Style TargetType="Controls:Fieldset">
        <Setter Property="Padding" Value="10"/>
        <Setter Property="Margin" Value="10"/>
        <Setter Property="BorderBrush" Value="#FFcccccc"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="LegendFontSize" Value="14"/>
        <Setter Property="LegendForeground" Value="Black"/>
        <Setter Property="FontSize" Value="14"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Controls:Fieldset">
                    <Grid x:Name="LayoutRoot" Margin="{TemplateBinding Margin}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="5"/>
                            <ColumnDefinition Width="20"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="5"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="5"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
    
                        <Border BorderThickness="1,1,0,0" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" CornerRadius="5,0,0,0"/>
                        <Border Grid.Column="1" BorderThickness="0,1,0,0" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}"/>
                        <Border Grid.Column="3" BorderThickness="0,1,0,0" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}"/>
                        <Border Grid.Column="4" BorderThickness="0,1,1,0" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" CornerRadius="0,5,0,0"/>
                        <Border Grid.ColumnSpan="5" Grid.Row="1" BorderThickness="1,0,1,1" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" CornerRadius="0,0,5,5"/>
                        <Border Background="{TemplateBinding Background}" Margin="0,1,0,0" Grid.Column="2"/>
                        <Grid  Grid.Column="2" Margin="10,-30,10,-30">
                            <TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="{TemplateBinding LegendFontSize}" Foreground="{TemplateBinding LegendForeground}" Text="{TemplateBinding Legend}"/>
                        </Grid>
                        <Border Background="{TemplateBinding Background}" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3"/>
                        <ContentPresenter
                            Grid.Column="1" 
                            Grid.ColumnSpan="3" 
                            Grid.Row="1"
                            Margin="{TemplateBinding Padding}" 
                            HorizontalAlignment="Stretch"
                            VerticalAlignment="Stretch"
                            Content="{TemplateBinding Content}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    

    And class:

    Public Class Fieldset
        Inherits ContentControl
    
        Public Sub New()
        End Sub
    
        Public Shared ReadOnly LegendProperty As DependencyProperty = DependencyProperty.
            Register("Legend", GetType(String), GetType(Fieldset), New PropertyMetadata(AddressOf OnLegendChanged))
    
        Private Shared Sub OnLegendChanged(ByVal d As DependencyObject, ByVal e As DependencyPropertyChangedEventArgs)
            Dim fieldset = TryCast(d, Fieldset)
            fieldset.Legend = e.NewValue.ToString()
        End Sub
    
        Public Property Legend As String
            Get
                Return Me.GetValue(LegendProperty).ToString()
            End Get
            Set(ByVal value As String)
                MyBase.SetValue(LegendProperty, value)
            End Set
        End Property
    
        Public Shared ReadOnly LegendFontSizeProperty As DependencyProperty = DependencyProperty.
            Register("LegendFontSize", GetType(Double), GetType(Fieldset), New PropertyMetadata(AddressOf OnLegendFontSizeChanged))
    
        Private Shared Sub OnLegendFontSizeChanged(ByVal d As DependencyObject, ByVal e As DependencyPropertyChangedEventArgs)
            Dim fieldset = TryCast(d, Fieldset)
            fieldset.LegendFontSize = CDbl(e.NewValue)
        End Sub
    
        Public Property LegendFontSize As Double
            Get
                Return CDbl(Me.GetValue(LegendFontSizeProperty))
            End Get
            Set(ByVal value As Double)
                MyBase.SetValue(LegendFontSizeProperty, value)
            End Set
        End Property
    
        Public Shared ReadOnly LegendForegroundProperty As DependencyProperty = DependencyProperty.
            Register("LegendForeground", GetType(SolidColorBrush), GetType(Fieldset), New PropertyMetadata(AddressOf OnLegendForegroundChanged))
    
        Private Shared Sub OnLegendForegroundChanged(ByVal d As DependencyObject, ByVal e As DependencyPropertyChangedEventArgs)
            Dim fieldset = TryCast(d, Fieldset)
            fieldset.LegendForeground = DirectCast(e.NewValue, SolidColorBrush)
        End Sub
    
        Public Property LegendForeground As SolidColorBrush
            Get
                Return DirectCast(Me.GetValue(LegendForegroundProperty), SolidColorBrush)
            End Get
            Set(ByVal value As SolidColorBrush)
                MyBase.SetValue(LegendForegroundProperty, value)
            End Set
        End Property
    End Class
    

    I apologize for the VB.NET code.

    As I said, probably lots of better solutions but here goes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am reading a book about Javascript and jQuery and using one of the
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a jquery bug and I've been looking for hours now, I can't
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.