Click here to Skip to main content
15,905,963 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I'm making a multipage art gallery website in a silverlight application on visual studio 2010. I've added buttons for navigation to different pages, but when I change the background colour in the properties the colour does not change?


<usercontrol x:class="LondonArtGallery.MainPage" xmlns:x="#unknown">
    d:DesignHeight="531" d:DesignWidth="882" xmlns:sdk="">

    <grid x:name="LayoutRoot" removed="#FF345C3E" height="531" width="882">
            <rowdefinition height="107*" />
            <rowdefinition height="424*" />
        <Button Content="Home" FontSize="16" Height="37" HorizontalAlignment="Left" Margin="76,13,0,0" Name="btnhome" VerticalAlignment="Top" Width="85" Grid.Row="1" Foreground="#FF211F1F" Background="#FF0D0DF8" Click="btnhome_Click">
                    <gradientstop color="#FFA3AEB9" offset="0" />
                    <gradientstop color="#FF8399A9" offset="0.375" />
                    <gradientstop color="#FF718597" offset="0.375" />
                    <gradientstop color="#8B231056" offset="1" />
        <textbox grid.row="1" height="239" horizontalalignment="Left" margin="76,48,0,0" name="txtContent" verticalalignment="Top" width="698" text="Welcome to the London Art Gallery website. Here you can view contempary artwork from some of the best artists today" textchanged="textBox1_TextChanged" verticalscrollbarvisibility="Visible" />
        <Image Height="107" HorizontalAlignment="Left" Margin="229,0,0,0" Name="image1" Stretch="Fill" VerticalAlignment="Top" Width="653" Source="/LondonArtGallery;component/Images/Banner.jpg" />
Updated 13-Nov-11 5:23am
Mark Salsbery 13-Nov-11 10:56am    
Show code! Do your buttons have a template that uses the Background property? The default button template may use a gradient or opaque version of the background color (see Button Styles and Templates[^]). Do you see your color when cursor moves over the buttons?
programmer1234 13-Nov-11 11:23am    
Code is now displayed in the question
Mark Salsbery 13-Nov-11 11:32am    
Cool thanks. If setting the Background property alone isn't giving you the look you want then you still may need to re-template the control to get your desired look. See the default template at the link I posted above.
programmer1234 13-Nov-11 11:45am    
That worked, thanks for your help.
thatraja 13-Nov-11 14:19pm    
Oops, I couldn't give you 5 here

1 solution

Styles and templates play a vital role in SilverLight control design. You can refer SilverLight button styles and templates at:[^]
Share this answer

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