Click here to Skip to main content
15,901,122 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I am new in the Silverlight.
I want to use a combobox and HTMLHost present in the Grid in the XAML file.
Means :

I have one dropdown having some website names.
<combobox name="comboBox1" margin="0,0,265,0">
                   <comboboxitem content="Google" />
                   <comboboxitem content="Microsoft" />
                   <comboboxitem content="Code Project" />
                   <comboboxitem content="Orkut" />
                   <comboboxitem content="Facebook" />
</combobox>

and below that I have HTMLHost which will put html in XAML.
<html:HtmlHost Name="googlehtmlHost" Grid.Row="2" SourceUri=Dropdown Value  />

Now when I run my application my dropdown goes behind the HTMLHost content.

So I need the dropdown to be on front of everything.

Please help.
Thanks in Advance.
Posted

You can try changing the control's z-index to bring it up front

How to set Z-Index in Silverlight control
 
Share this answer
 
Comments
kulkarni.ajay 3-Aug-11 8:02am    
Thanks.
I tried this but not worked in my case.
The WebBrowser control is not a silverlight object and sits on top of all content. You need to flip Visibility between the WebBrowser control and a rectangle with the fill set to WebBrowserBrush when the combobox dropdown is visible and back when it's not. something like:

XML
<WebBrowser x:Name="browserControl" Source="{Binding URL}" />
<Rectangle x:Name="browserControlRect" >
    <Rectangle.Fill>
        <WebBrowserBrush SourceName="browserControl" />
    </Rectangle.Fill>
</Rectangle>


Then either VSM, Behaviours, or code to do the toggling.
 
Share this answer
 
Comments
kulkarni.ajay 4-Aug-11 4:49am    
Thanks again.

So by this post I can only flip the visibility of the contents.
But is there any another way where I can normally get the dropdown on the top of everything.

Please help me out.
Graeme_Grant 4-Aug-11 9:53am    
WebBrowser control is special but for other controls, change the Z-Index of the control you want on top.

I have a working example of how to change the Z-Index of a control from code at http://www.codeproject.com/KB/silverlight/ListDragDropSL.aspx

In this example, to change the Z-Index of a specific control, I had to remove and add the control.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900