locked
how to mold a simple usercontrol or window to rounded corner window? RRS feed

  • Question

  • Hi..

    I am new to Expression blend.

    I am to create a rounded corner window. how can i do it and how can i mold in other shapes?


    maifs
    Tuesday, May 17, 2011 10:56 AM

Answers

  • Yes you can in WPF I am not sure about Silverlight in a browser No but maybe out of browser.
    You need to make your application form background transparent and set AllowsTransparency to True and WindowStyle to none

    This will produce a form with only an elipse
    Window x:Class="WPFPlay.MainWindow"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            Title="MainWindow" Height="350" Width="525" AllowsTransparency="True" WindowStyle="None">
        <Window.Background>
            <SolidColorBrush />
        </Window.Background>
        <Grid>
            <Ellipse  HorizontalAlignment="Stretch" Name="ellipse1" VerticalAlignment="Stretch" Fill="Red" />
        </Grid>
    </Window> 

    If you want more obsure shapes you can create them in Expression Design and export them to Blend


    jnc
    • Proposed as answer by jnc Wednesday, June 8, 2011 8:34 AM
    • Marked as answer by Mehmood Ahmed Thursday, June 9, 2011 8:45 AM
    Friday, May 27, 2011 8:46 AM

All replies

  • If I understand what you mean by mould The best thing is to make the controls inside the border/window have transparent borders and backgrounds themselves

    or place individual controls inside it's own matching (rounded corners) border


    jnc
    Tuesday, May 17, 2011 3:12 PM
  • Thanks but i still didn't understand. Can i give a different shape instead of a rectangle window/user control.

    Firstly I want to change the window style from rectangular to rounded corner then i want to change the window style through scattered point (mean polygon). can it be possible?


    maifs
    • Proposed as answer by jnc Wednesday, June 8, 2011 8:34 AM
    • Unproposed as answer by jnc Wednesday, June 8, 2011 8:34 AM
    Wednesday, May 18, 2011 4:20 AM
  • Yes you can in WPF I am not sure about Silverlight in a browser No but maybe out of browser.
    You need to make your application form background transparent and set AllowsTransparency to True and WindowStyle to none

    This will produce a form with only an elipse
    Window x:Class="WPFPlay.MainWindow"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            Title="MainWindow" Height="350" Width="525" AllowsTransparency="True" WindowStyle="None">
        <Window.Background>
            <SolidColorBrush />
        </Window.Background>
        <Grid>
            <Ellipse  HorizontalAlignment="Stretch" Name="ellipse1" VerticalAlignment="Stretch" Fill="Red" />
        </Grid>
    </Window> 

    If you want more obsure shapes you can create them in Expression Design and export them to Blend


    jnc
    • Proposed as answer by jnc Wednesday, June 8, 2011 8:34 AM
    • Marked as answer by Mehmood Ahmed Thursday, June 9, 2011 8:45 AM
    Friday, May 27, 2011 8:46 AM