This is a migrated thread and some comments may be shown as answers.

Visual Studio Designer Problem

3 Answers 213 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Andriy
Top achievements
Rank 1
Andriy asked on 21 Jan 2016, 05:13 PM

Hello,
I'm creating a new WPF application and would like to use implicit styles. The application currently uses the VisualStudio2013 theme.

In Designer everything is fine but when I run my application, the position or size of some controls are changed.

How can I have the Visual Studio designer or my app display the controls correctly?

 

 Example:

 

3 Answers, 1 is accepted

Sort by
0
Andriy
Top achievements
Rank 1
answered on 21 Jan 2016, 09:58 PM

Another example.

Also when I use HorizontalAlignment="Stretch" for control it looks like in designer. But when I use HorizontalAlignment="Left" or HorizontalAlignment="Right" I have this problem.

0
Andriy
Top achievements
Rank 1
answered on 22 Jan 2016, 01:48 PM
Another example with new project. Only added groupbox. Maybe problem is with window size. It not the same as in designer. 
0
Masha
Telerik team
answered on 26 Jan 2016, 08:07 AM
Hello Andriy,

As you guessed the problem comes from the default WPF Window which looks different from VS designer when running. The margins in WPF window are shown only in the design time. If you want to keep them you need to defined them in Xaml on your parent element. Check the code snippet below:

<Window x:Class="DemoProject.MainWindow"
        Title="MainWindow"
        Height="140" Width="525">
    <StackPanel Margin="8">
        <GroupBox Header="Title">
            <telerik:RadWatermarkTextBox Text="text" HorizontalAlignment="Left" Width="60"/>
        </GroupBox>
 
        <telerik:RadButton Content=" Button"  HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0 2 2 0"/>
    </StackPanel>
</Window>

Let me know if this helps. If you still have issues with the designer and runtime look, please share part of  your xaml to check where the problem comes from.


Regards,
Masha
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Andriy
Top achievements
Rank 1
Answers by
Andriy
Top achievements
Rank 1
Masha
Telerik team
Share this question
or