Cómo: WPF con fondo transparente
Viernes, marzo 19, 2010 15:23Posted in category Sin categoría
Siguiendo la línea de Cómo en WPF este tip te demostrará cómo crear una ventana con fondo transparente:
Para ello sólo debes agregar al Tag Window el parámetro AllowTransparency=”True” y sumándolo al post anterior de cómo realizar una ventana sin bordes con WPF nos queda este código:
<window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="WpfApplication2.MainWindow"
x:Name="Window"
Title="MainWindow"
AllowsTransparency="True"
WindowStyle="None" ResizeMode="NoResize"
Width="640" Height="480" Background="{x:Null}">
<grid x:Name="LayoutRoot">
<ellipse Fill="#FF570C0C" Stroke="Black" Margin="232,124,60,101" Width="100" Height="100"/>
</grid>
</window>
Ojalá les sirva de algo
Saludos
<Window
xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation”
xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml”
x:Class=”WpfApplication2.MainWindow”
x:Name=”Window”
Title=”MainWindow”
AllowsTransparency=”True”
WindowStyle=”None” ResizeMode=”NoResize”
Width=”640″ Height=”480″ Background=”{x:Null}”>
xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation”
xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml”
x:Class=”WpfApplication2.MainWindow”
x:Name=”Window”
Title=”MainWindow”
AllowsTransparency=”True”
WindowStyle=”None” ResizeMode=”NoResize”
Width=”640″ Height=”480″ Background=”{x:Null}”>
<Grid x:Name=”LayoutRoot”>
<Grid.ColumnDefinitions>
<ColumnDefinition Width=”0.82*”/>
<ColumnDefinition Width=”0.18*”/>
</Grid.ColumnDefinitions>
<Ellipse Fill=”#FF570C0C” Stroke=”Black” Margin=”232,124,60,101″/>
</Grid>
</Window>
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.
BredeBS » Cómo: WPF Mover la ventana con cualquier elemento says:
marzo 19th, 2010 at 15:34
[...] código del Post “Cómo WPF con Fondo Transparente” le agregaremos un evento para cuando se ‘mantenga pulsado el botón izquierdo del [...]