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

  • SEARCH
  • Home
  • 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 8929507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:41:06+00:00 2026-06-15T08:41:06+00:00

Windows Phone 8, XAML. I have two stretched Line objects in a horizontal StackPanel

  • 0

Windows Phone 8, XAML. I have two stretched Line objects in a horizontal StackPanel next to one another. There’s no left or right margin in either of those. Yet there’s a clearly visible gap between them. The XAML goes:

<StackPanel x:Name="Root" Orientation="Horizontal">

    <Line
        x:Name="LHLine11"
        Margin="0,50,0,0"
        Stretch="Fill"
        Width="10"
        X1="0" X2="1" Y1="0" Y2="0"
        StrokeThickness="1"
        VerticalAlignment="Top"
        Stroke="{StaticResource PhoneButtonBasePressedForegroundBrush}"
        />

    <Line
        x:Name="LHLine1"
        Margin="0,50,0,0"
        Stretch="Fill"
        Width="10"
        X1="0" X2="1" Y1="0" Y2="0"
        StrokeThickness="1"
        VerticalAlignment="Top"
        Stroke="{StaticResource PhoneButtonBasePressedForegroundBrush}"
        />
   </StackPanel>

How come?

In case you’re wondering why don’t I make a single, longer line: this is a minimal example that demonstrates the behavior.

  • 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-06-15T08:41:07+00:00Added an answer on June 15, 2026 at 8:41 am

    I can’t explain as to WHY there’s apparently a 1 pixel gap when you use the Line element, it seems to be distinct to just that, perhaps an inane bug in the measuring method? A couple quick little workarounds though would be to add a -1 margin to the connecting side of one of the lines. Or you could just replace them with Rectangles instead and accomplish the same thing without the 1 pixel gap.

    <StackPanel Orientation="Horizontal">
        <Rectangle Height="1" Fill="Blue" Width="50"/>
        <Rectangle Height="1" Fill="Red" Width="50"/>
    </StackPanel>
    

    Hopefully this is at least somewhat helpful. Cheers

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

Sidebar

Related Questions

I have the following XAML in my Windows Phone app : <StackPanel Orientation=Horizontal> <Grid
I'm developing a Windows Phone application . I have defined this on App.xaml: <nav:UriMapping
I have two small problems/questions about app development in Windows Phone 7. 1: I
I have two XAML pages. One page (named Page1) has a listbox named strangers
Windows Phone 7. I have a ScrollViewer inside a StackPanel inside a PivotItem inside
I have a XAML page in a separate Windows Phone class library. The library
In Windows Phone 7 -> IsolatedStorageSettings class we have two functions Add() and Save().
I have a Silverlight Windows Phone 7 app with two pages. I want to
I have a windows phone 7 app with some xaml that looks like: <Grid
I have a ListBox in a xaml page for a Windows Phone 7 app.

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.