Results 1 to 5 of 5

Thread: [RESOLVED] Dashed Borders - No Clue.

  1. #1

    Thread Starter
    Frenzied Member sciguyryan's Avatar
    Join Date
    Sep 2003
    Location
    Wales
    Posts
    1,763

    Resolved [RESOLVED] Dashed Borders - No Clue.

    Hi guys.

    I'm working on a new project and seem to be a little stuck. Frankly MS should have included the ability to draw dashed and dotted borders directly into the border control.

    I have blocks of XAML like this:

    Code:
    <Border Grid.Column="1" Grid.Row="8" Style="{StaticResource AlkaliMetalDecay}">
        <StackPanel Style="{StaticResource ElementStack}">
            <TextBlock Style="{StaticResource StateSolid}">87</TextBlock>
            <TextBlock>Fr</TextBlock>
        </StackPanel>
    </Border>
    What I need is for the border element here to show a dotted border around the content. I've got no idea how this should be done, though it could probably be done by combining a template for the StackPanel and a Rectangle element - though I have no idea how.
    My Blog.

    Ryan Jones.

  2. #2
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: Dashed Borders - No Clue.

    Frankly MS should have included the ability to draw dashed and dotted borders directly into the border control
    Why? I've never seen that in any application... so why would they include it as a built in feature? Just because it happens to be what you want, doesn't mean it deserves to be built in to WPF.

    Anywho, I'll have a play around and see what I can come up with.
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  3. #3

    Thread Starter
    Frenzied Member sciguyryan's Avatar
    Join Date
    Sep 2003
    Location
    Wales
    Posts
    1,763

    Re: Dashed Borders - No Clue.

    Borders are borders, naturally assuming everyone wants a solid border was a huge mistake (after a few minutes searching Google I found hundreds of people saying the same thing).

    Anyway. I figured out a way to cheat. I basically used a grid element to position a rectangle object with a dashed array border directly over the element in question - and that worked as I wanted
    My Blog.

    Ryan Jones.

  4. #4
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: Dashed Borders - No Clue.

    Ah cool, glad you got it working and thanks for sharing the solution.

    PS you can search for pretty much anything in google and find hundreds of people asking the same question :P
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  5. #5

    Thread Starter
    Frenzied Member sciguyryan's Avatar
    Join Date
    Sep 2003
    Location
    Wales
    Posts
    1,763

    Re: Dashed Borders - No Clue.

    Yeah, that's true but that still doesn't change the fact that it is a sensible thing to include - it is even in CSS after all.
    My Blog.

    Ryan Jones.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width