The following forum(s) have migrated to Microsoft Q&A (Preview): Developing Universal Windows apps!
Visit Microsoft Q&A (Preview) to post new questions.

Learn More

 locked
XAML form looks different in debug than it does it design RRS feed

  • Question

  • Hi all,

    I'm developing a UWP app, and for some reason one (but only one) of my forms looks different in debug than it does in design.  The listbox is too large and elements are misaligned.  I tried deleting and recreating the form and I immediately get the same result.

    Here are images of what I'm talking about: https://imgur.com/a/1f5eTFD

    Saturday, July 13, 2019 1:02 PM

All replies

  • Hi,
    at design time you have an another (design) size of Window/Page as the size at run time but the Margins are fixed.

    --
    Best Regards / Viele Grüße
    Peter Fleischer (former MVP for Developer Technologies)
    Homepage, Tipps, Tricks

    Saturday, July 13, 2019 1:47 PM
  • I'm confused, what do you mean?
    Sunday, July 14, 2019 7:46 PM
  • Hi,

    Generally it should looks the same as it looks like in the design time. Have you checked the type of the design window? Like this?

    Best regards,

    Roy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, July 15, 2019 2:55 AM
    Moderator
  • Yes, I have. What about it? My other forms all have the same setting (23" Desktop 1920x1080, 100% scale) but only this one form is having this problem. Is there something I should be looking for?
    Monday, July 15, 2019 5:30 PM
  • Hi,

    Could you please share me with the xaml code snippet you are using? I need to made a test about this.

    Best regards.

    Roy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, July 16, 2019 2:54 AM
    Moderator
  • Sorry for the late response. Here it is: 

    <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <DropDownButton Content="Saved Foods" FontSize="20" Height="45" Width="155"  Grid.Column="2" VerticalAlignment="Top" Margin="465,972,0,0">

                <DropDownButton.Flyout>
                    <MenuFlyout Placement="Bottom">
                        <MenuFlyoutItem x:Name="btnAdd" Text= "Add New Food" Click="btnAdd_Click">
                            <MenuFlyoutItem.Icon>
                                <SymbolIcon Symbol="Add"/>
                            </MenuFlyoutItem.Icon>
                        </MenuFlyoutItem>
                        <MenuFlyoutItem Text="Delete Food">
                            <MenuFlyoutItem.Icon>
                                <SymbolIcon Symbol="Delete"/>
                            </MenuFlyoutItem.Icon>
                        </MenuFlyoutItem>
                        <MenuFlyoutItem Text="Log this Food"/>
                    </MenuFlyout>
                </DropDownButton.Flyout>
            </DropDownButton>
            <Button Style="{StaticResource NavigationBackButtonNormalStyle}" FontSize="40" Canvas.Left="10" Canvas.Top="10">
            </Button>
            <ListBox Height="521" Width="241" Grid.Column="2" Margin="320,279,79,280">

            </ListBox>

    Monday, July 22, 2019 1:52 AM
  • Hi,

    What's the resolution of your screen? Are you the same resolution with 1920x1080, 100% scale? I made a test with your code. It looks like this in designer in 1920x1080, 100% scale:

    And it looks like this when I debug:


    My screen is 1920x1080, 100% scale. Please check the resolution of your screen.

    Best regards,

    Roy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Monday, July 22, 2019 3:26 AM
    Moderator