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 7603901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:46:13+00:00 2026-05-30T23:46:13+00:00

Could you please tell me where I have gone wrong, my frame size takes

  • 0

Could you please tell me where I have gone wrong, my frame size takes the size of the wpf window, code is:

<Window x:Class="MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="BSP" Height="700" Width="990" WindowStartupLocation="CenterScreen">
    <Grid Background="Green" VerticalAlignment="Center" HorizontalAlignment="Center" >
            <Frame Name="MainFrame" Source="LoginScreen.xaml" NavigationUIVisibility="Hidden" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"  />        
    </Grid>
</Window>

The page size less than the window and also the total size of margin+width+size of label is less than the size of page yet the button is being displayed as cut. Code for the page is below:

<Page x:Class="Loggedin"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      mc:Ignorable="d" 
      Height="660" Width="920"
      Title="Loggedin">  
      <Grid Background="white" Margin="2">
        <StackPanel Orientation="Horizontal" VerticalAlignment="Top" >
            <Label Content="Loggedin as" Height="28" HorizontalAlignment="Left" Name="Loggedinas" />
            <Button Content="LogOut" Margin="780,0,0,0" Height="28" Name="Logout" Width="50" HorizontalAlignment="Right"/>
        </StackPanel>
      </Grid>
</Page>

Could you please assist me, it is eating my brain from 2 days :(. Following are pics of output:
Pic from Visual Studios: http://clip2net.com/s/1Fpb7

Pic from Runtime: http://clip2net.com/s/1FpbQ

  • 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-30T23:46:15+00:00Added an answer on May 30, 2026 at 11:46 pm

    Have you thought about using a DockPanel instead of a StackPanel? It seems to be a closer fit for the layout you’re trying to achieve :

        <DockPanel VerticalAlignment="Top">
            <Label Content="Loggedin as" Height="28" HorizontalAlignment="Left" Name="Loggedinas" />
            <Button Content="LogOut" Height="28" Name="Logout" Width="50" HorizontalAlignment="Right"/>
        </DockPanel>
    

    Any time you have margins that look like Margin="780,0,0,0" it usually means you’re working too hard and there’s a better way to do it. In my quick scratch tests, the 780 pixel left margin was pushing the button off the frame.

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

Sidebar

Related Questions

Could someone please tell me what I am doing wrong here. I have compiled
Could someone please tell me what is wrong with my code. When I try
Could someone please tell me what is wrong with the below code? For some
I have the following mysql query. Could you please tell me how to write
I have a long standing doubt. Could someone please tell me whether method overloading
Could you please tell me why I have waiting mouse cursor in my gwt
I have the following: http://jsfiddle.net/mVs9T/13/ Could someone please tell me why the output is
Could somebody please tell me what is Memory Page Out Rate. I have seen
I have a question about Javascript Variable Declare. Could you please tell me what's
I have the number -37 in decimal. Could you please tell me what its

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.