C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » WPF »

Web browser doesn't popup when WIndow style set to AllowsTransparency="True"


Posted Date: 29 Oct 2009      Posted By: Rammohan      Member Level: Bronze     Points: 1   Responses: 3



Hi,

I'm facing an issue, when using Window style set to AllowsTransparency="True" WindowStyle="None", my webbrowser control doesn't visible, rather they gets hidden (not visible) and if i just seen the souce data is available.

However, if I revert back the Window style to normal without Transparency then webbrowser control visible perfectly.
I'm not sure what could be an issue? pls help out me..



Thanks & Regards
Ram





Responses

Author: ABitSmart    29 Oct 2009Member Level: DiamondRating: 2 out of 52 out of 5     Points: 2

Can you share the XAML Code you are using ?

Kind regards,
ABitSmart
DNS Web-master, DNS MVM
My blog
Thoughts.exe



Author: Rammohan    30 Oct 2009Member Level: BronzeRating: 2 out of 52 out of 5     Points: 2

<Window x:Class="xxx.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
ShowInTaskbar="False"
Title="Clearway" Height="702.5" Width="405" AllowDrop="True" ResizeMode="CanResizeWithGrip" AllowsTransparency="True" ShowActivated="False" Loaded="Window_Loaded_1" WindowStyle="None" Style="{DynamicResource WindowStyle1}" Background="{x:Null}">
<Window.Resources>
<Style x:Key="inputStyle" TargetType="{x:Type TextBox}">
<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>

<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
<Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="Padding" Value="2"/>
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
<Setter Property="AllowDrop" Value="true"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TextBox}">
<Border x:Name="Bd" SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="6" BorderBrush="#FF2A2A2A">
<ScrollViewer x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<ControlTemplate x:Key="WindowTemplateKey" TargetType="{x:Type Window}">
<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
<Grid>
<AdornerDecorator>
<ContentPresenter/>
</AdornerDecorator>
<ResizeGrip x:Name="WindowResizeGrip" HorizontalAlignment="Right" VerticalAlignment="Bottom" IsTabStop="false" Visibility="Collapsed"/>
</Grid>
</Border>
<ControlTemplate.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="ResizeMode" Value="CanResizeWithGrip"/>
<Condition Property="WindowState" Value="Normal"/>
</MultiTrigger.Conditions>
<Setter Property="Visibility" TargetName="WindowResizeGrip" Value="Visible"/>
</MultiTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<Style x:Key="WindowStyle1" TargetType="{x:Type Window}">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}"/>
<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Window}">
<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
<AdornerDecorator>
<ContentPresenter/>
</AdornerDecorator>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="ResizeMode" Value="CanResizeWithGrip">
<Setter Property="Template" Value="{StaticResource WindowTemplateKey}"/>
</Trigger>
</Style.Triggers>
</Style>
</Window.Resources>
<Grid x:Name="BaseGrid">
<Grid.RowDefinitions>
<RowDefinition Height="10"/>
<RowDefinition x:Name="TopBorderRow" Height="8"/>
<RowDefinition x:Name="CaptionRow" Height="64"/>
<RowDefinition Height="*" />
<RowDefinition x:Name="BottomToolbar" Height="36"/>
<RowDefinition Height="8" />
<RowDefinition Height="6" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="10"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="8"/>
<ColumnDefinition Width="8"/>
</Grid.ColumnDefinitions>
<Path x:Name="PathTopLeft" Grid.Row="1" Grid.RowSpan="2" Grid.Column="0" Grid.ColumnSpan="2" Stretch="Fill" Fill="#033b54" Data="M 7.85417,15.9792L 7.85417,8L 15.8125,8L 15.7917,0L 7.91667,0C 6.8125,0.0833321 6.10417,0.125 5.14583,0.541668C 4.66667,0.75 3.79167,1.125 2.8125,1.9375C 1.7808,2.79359 1.375,3.47917 1.04167,4.08333C 0.525434,5.019 0.25,5.85417 0.104167,6.6875C 0.0275529,7.12529 0,7.60417 0,7.60417L 0,15.9792L 7.85417,15.9792 Z " Height="15.979" HorizontalAlignment="Left" VerticalAlignment="Top" Width="15.812" Margin="0"/>
<Path x:Name="PathTopRight" Grid.Row="1" Grid.RowSpan="2" Grid.Column="1" Grid.ColumnSpan="2" Stretch="Fill" Fill="#033b54" Data="M 32.1458,15.9792L 32.1458,8L 24.1875,8L 24.2083,0L 32.0833,0C 33.1875,0.0833321 33.8958,0.125 34.8542,0.541668C 35.3333,0.75 36.2083,1.125 37.1875,1.9375C 38.2192,2.79359 38.625,3.47917 38.9583,4.08333C 39.4746,5.019 39.75,5.85417 39.8958,6.6875C 39.9724,7.12529 40,7.60417 40,7.60417L 40,15.9792L 32.1458,15.9792 Z " Height="15.979" HorizontalAlignment="Right" Margin="0" VerticalAlignment="Top" Width="15.812" />
<Path x:Name="PathBottomLeft" Grid.Row="4" Grid.RowSpan="2" Grid.Column="0" Grid.ColumnSpan="2" Stretch="Fill" Fill="#033b54" Data="M 7.85417,24.0208L 7.85417,32L 15.8125,32L 15.7917,40L 7.91667,40C 6.8125,39.9167 6.10417,39.875 5.14583,39.4583C 4.66667,39.25 3.79167,38.875 2.8125,38.0625C 1.7808,37.2064 1.375,36.5208 1.04167,35.9167C 0.525434,34.981 0.25,34.1458 0.104167,33.3125C 0.0275529,32.8747 0,32.3958 0,32.3958L 0,24.0208L 7.85417,24.0208 Z " Height="15.979" HorizontalAlignment="Left" Margin="0" VerticalAlignment="Bottom" Width="15.812" />
<Path x:Name="PathBottomRight" Grid.Row="4" Grid.RowSpan="2" Grid.Column="1" Grid.ColumnSpan="2" Stretch="Fill" Fill="#033b54" Data="M 32.1458,24.0208L 32.1458,32L 24.1875,32L 24.2083,40L 32.0833,40C 33.1875,39.9167 33.8958,39.875 34.8542,39.4583C 35.3333,39.25 36.2083,38.875 37.1875,38.0625C 38.2192,37.2064 38.625,36.5208 38.9583,35.9167C 39.4746,34.981 39.75,34.1458 39.8958,33.3125C 39.9724,32.8747 40,32.3958 40,32.3958L 40,24.0208L 32.1458,24.0208 Z " Height="15.979" HorizontalAlignment="Right" Margin="0" VerticalAlignment="Bottom" Width="15.812"/>
<Rectangle x:Name="borderLeft" Stroke="Black" Fill="#033b54" Opacity="1" StrokeThickness="0" RadiusX="0" RadiusY="0" Grid.Row="2" Grid.RowSpan="3"/>
<Rectangle x:Name="borderRight" Stroke="Black" Fill="#033b54" Opacity="1" StrokeThickness="0" RadiusX="0" RadiusY="0" Grid.Row="2" Grid.Column="2" Grid.RowSpan="3"/>
<Rectangle x:Name="borderTop" Stroke="Black" Fill="#033b54" Opacity="1" StrokeThickness="0" RadiusX="0" RadiusY="0" Grid.Row="1" Grid.Column="1"/>
<Rectangle x:Name="borderBottom" Stroke="Black" Fill="#033b54" Opacity="1" StrokeThickness="0" RadiusX="0" RadiusY="0" Grid.Row="5" Grid.Column="1"/>
<Rectangle x:Name="rectangleBorder" Margin="1,1,1,1" Stroke="White" Opacity=".7" StrokeThickness="1" RadiusX="7.5" RadiusY="7.5" Grid.Column="0" Grid.ColumnSpan="3" Grid.Row="1" Grid.RowSpan="5" />
<Rectangle x:Name="rectangleCaption" Margin="0" Stroke="Black" Fill="#033b54" Opacity="1" StrokeThickness="0" RadiusX="0" RadiusY="0" Grid.Column="1" Grid.ColumnSpan="1" Grid.Row="2" Grid.RowSpan="1" />
<Rectangle x:Name="rectangleBottomToolbar" Margin="0" Stroke="Black" Fill="#033b54" Opacity="1" StrokeThickness="0" RadiusX="0" RadiusY="0" Grid.Column="1" Grid.ColumnSpan="1" Grid.Row="4" Grid.RowSpan="1" />
<Image x:Name="ClearwayIcon" Grid.Column="0" Grid.ColumnSpan="3" Grid.Row="0" Grid.RowSpan="3" Margin="8,12,0,0" Source="/Clearway;component/CommandPanel/Icons/CWRhombus.png" HorizontalAlignment="left" VerticalAlignment="Top" Width="45" Height="45" Tag="false" IsHitTestVisible="False" IsEnabled="False" />
<Grid x:Name="TopToolbar" Grid.Column="1" Grid.Row="2" Grid.RowSpan="1" Height="36" VerticalAlignment="Bottom">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Canvas Margin="98.842,-344.226,49.658,0" x:Name="TopCanvasToolBar" VerticalAlignment="Top" Height="44.226" />
</Grid>
<Grid x:Name="CaptionSection" Grid.Column="1" Grid.Row="2" Visibility="Visible" Opacity="1">
<Grid.RowDefinitions>
<RowDefinition Height="24"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="26"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="150"/>
<ColumnDefinition Width="22"/>
</Grid.ColumnDefinitions>
<Label x:Name="TheClearwayCaption" Content="Clearway" Margin="14,3" Grid.Column="1" Grid.RowSpan="2" FontSize="12" FontWeight="Bold" Foreground="White" FontStyle="Normal" IsEnabled="False" IsHitTestVisible="False" Visibility="Hidden"/>
<Image x:Name="TheClearwayCaptionImage" Margin="18, 8" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Top" Grid.RowSpan="2" Source="/Clearway;component/CommandPanel/Icons/CWTextNoBg.png" Width="67" Height="20" IsEnabled="False" IsHitTestVisible="False" />
<TextBox Height="23" Width="150" Grid.Column="2" TextWrapping="Wrap" x:Name="SearchKeywords" VerticalAlignment="Center" HorizontalAlignment="Left" Style="{DynamicResource inputStyle}" FontSize="13" Foreground="#FF666666" />
<Image x:Name="SearchMe" VerticalAlignment="Center" Grid.Column="3" Margin="0,-4" Source="/Clearway;component/Icons/search.png" HorizontalAlignment="Center" Width="18" Height="18" Tag="false" />
<Grid x:Name="TopToolbarSection" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="4" Visibility="Visible" Opacity="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="250"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Rectangle x:Name="TopToolbarLeftBar" Margin="8,0,0,0" Grid.Column="0" Opacity=".6" VerticalAlignment="Center" Height="2" Fill="DimGray" />
<Rectangle x:Name="TopToolbarRightBar" Margin="0,0,8,0" Grid.Column="2" Opacity=".6" VerticalAlignment="Center" Height="2" Fill="DimGray" />
</Grid>
</Grid>
<Image Margin="20,0,0,0" MouseLeftButtonDown="ExitButton_MouseLeftButtonDown" x:Name="ExitButton" Grid.Column="1" Grid.ColumnSpan="3" Grid.Row="0" Grid.RowSpan="3" Source="/Clearway;component/Icons/CloseX.png" Stretch="Fill" HorizontalAlignment="Right" VerticalAlignment="Top" AllowDrop="True" SnapsToDevicePixels="True" StretchDirection="Both" Width="24" Height="24" />
<Grid x:Name="BottomToolbarSection" Grid.Row="4" Grid.RowSpan="1" Grid.Column="1" Grid.ColumnSpan="1" Visibility="Visible" Opacity="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="250"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Rectangle x:Name="BottomToolbarLeftBar" Margin="8,0,0,0" Grid.Column="0" Opacity=".6" VerticalAlignment="Center" Height="2" Fill="DimGray" />
<Rectangle x:Name="BottomToolbarRightBar" Margin="0,0,8,0" Grid.Column="2" Opacity=".6" VerticalAlignment="Center" Height="2" Fill="DimGray" />

<Rectangle x:Name="CenterRect" Fill="Black" Margin="21.092,5,25.408,0" Grid.Column="1" Opacity=".02" RenderTransformOrigin="0.5,0.5" Grid.ColumnSpan="2">
<Rectangle.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform Angle="-0.219"/>
<TranslateTransform/>
</TransformGroup>
</Rectangle.RenderTransform>
</Rectangle>
<Canvas Grid.Column="1" Margin="73.88,-44,-3.88,17" x:Name="BottonCanvasToolbar" Grid.ColumnSpan="2" />

</Grid>
<Grid Name="BodySection" Background="AliceBlue" Visibility="Visible" Margin="6,3,6,6" Grid.Column="1" Grid.Row="3">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid Name="TopBodyPanel" Grid.Row="0">
<Grid.RowDefinitions>
<RowDefinition Height="40" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="25" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="24" />
</Grid.ColumnDefinitions>
<Rectangle Name="TopBodyPanelCaption" Margin="0" Stroke="Black" Fill="Red" Opacity="1" StrokeThickness="1" RadiusX="0" RadiusY="0" Grid.Column="0" Grid.ColumnSpan="5" Grid.Row="0" Grid.RowSpan="1" IsHitTestVisible="True" IsEnabled="True" AllowDrop="True" />
<Image Name="TopBodyPanelCheckbox" Source="/Clearway;component/SmallIcons/UnCheckedBox.png" Width="16" Height="16" VerticalAlignment="Top" Margin="0,5" Tag="false" />
<Label Padding="0,0,0,0" Grid.Row="0" Grid.Column="1" Name="TopPanelCaption" Margin="0,5,0,0" Opacity=".75" Content="" Foreground="Black" FontSize="12" FontWeight="Bold" HorizontalAlignment="Left" VerticalAlignment="Top" SnapsToDevicePixels="True" IsEnabled="True" IsHitTestVisible="True"></Label>
<Label Padding="0,0,0,0" Grid.Row="0" Grid.Column="1" Name="TopPanelStatistics" Margin="20,0,0,5" Content="" Opacity=".5" Foreground="Black" FontSize="11" FontWeight="Bold" HorizontalAlignment="Left" VerticalAlignment="Bottom" SnapsToDevicePixels="True" IsEnabled="False" IsHitTestVisible="False" AllowDrop="True"></Label>
<WebBrowser Name="TopBodyPanelBrowserHost" Grid.Column="0" Grid.ColumnSpan="5" Grid.Row="1" Margin="0,0,0,4" AllowDrop="True" OverridesDefaultStyle="False"></WebBrowser>
<Button Grid.Row="1" Margin="70,19,54,47" Name="button1" Visibility="Hidden">Button</Button>
<Image Name="TopBodyPanelBackButton" Source="/Clearway;component/Icons/History.png" Width="22" Height="18" Grid.Column="2" VerticalAlignment="Center" Margin="0,2" Tag="false" />
</Grid>
<Grid Name="BottomBodyPanel" Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="40" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="25" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="24" />
</Grid.ColumnDefinitions>
<Rectangle Name="BottomBodyPanelCaption" Margin="0" Stroke="Black" Fill="WhiteSmoke" Opacity="1" StrokeThickness="1" RadiusX="0" RadiusY="0" Grid.Column="0" Grid.ColumnSpan="5" Grid.Row="0" Grid.RowSpan="1" IsHitTestVisible="True" AllowDrop="True" />
<Image Name="BottomBodyPanelCheckbox" Source="/Clearway;component/SmallIcons/UnCheckedBox.png" Width="16" Height="16" VerticalAlignment="Top" Margin="0,5" Tag="false" />
<Label Padding="0,0,0,0" Grid.Row="0" Grid.Column="1" Name="BottomPanelCaption" Margin="0,5,0,0" Opacity=".75" Content="" Foreground="Black" FontSize="12" FontWeight="Bold" HorizontalAlignment="Left" VerticalAlignment="Top" SnapsToDevicePixels="True" IsEnabled="True" IsHitTestVisible="True" AllowDrop="True"></Label>
<Label Padding="0,0,0,0" Grid.Row="0" Grid.Column="1" Name="BottomPanelStatistics" Margin="20,0,0,5" Content="" Opacity=".5" Foreground="Black" FontSize="11" FontWeight="Bold" HorizontalAlignment="Left" VerticalAlignment="Bottom" SnapsToDevicePixels="True" IsEnabled="False" IsHitTestVisible="False" AllowDrop="True"></Label>
<WebBrowser Name="BottomBodyPanelBrowserHost" Grid.ColumnSpan="3" Grid.Row="1" Margin="0,1,0,0"></WebBrowser>
<Image Name="BottomBodyPanelBackButton" Source="/Clearway;component/Icons/History.png" Width="22" Height="18" Grid.Column="2" VerticalAlignment="Center" Margin="0,2" Tag="false" />
</Grid>
<GridSplitter HorizontalAlignment="Stretch" Name="gridSplitter1" Height="4" VerticalAlignment="Bottom" BorderThickness="1" BorderBrush="Black" Opacity="0.5" Focusable="False" Background="CadetBlue" />
</Grid>
</Grid>
</Window>



Author: Rammohan    30 Oct 2009Member Level: BronzeRating: 2 out of 52 out of 5     Points: 2

Hi

for your reference purpose u just place the one webbrowser control and set windowstyle="None", AllowTransferency="True" data is not comming... if allowTransferency="False", data is comming just check it.
if u have any solutions, pls let me know.

Thanks
Ram



Post Reply
You must Sign In to post a response.
Next : Can anyone tell me working with Menu in WPF in detail
Previous : From Windows Application To WPF
Return to Discussion Forum
Post New Message
Category: WPF

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use