cvarro Posted October 10, 2008 Report Share Posted October 10, 2008 Is it possible to control the style of the scroll bar in the legend box? I'd like to change the fill color of the slider, since it doesn't show well against the background colors we are using. I haven't had much luck...any advice? Thanks for the help! Quote Link to comment Share on other sites More sharing options...
JuanC Posted October 15, 2008 Report Share Posted October 15, 2008 We have a somewhat obscure property called MergeResources (note that is not browsable so it will not appear in IntelliSense) that we use to allow different styles - Glass, Basic, Simple - to have different common resources such as ScrollBar styles. We did not use the Resources.MergeDictionaries WPF feature because of leaks when using this approach. The following code will remove the scrollbar style included in our motif so that you can add your own, if you test this code against a Glass chart you will get a windows-themed scrollbar. You could then create your own ScrollBar style and add it to the resourceDictionary variable. Note that you have to set the MergeResources to point to a new resource dictionary as we do not track changes to the existing one. ResourceDictionary resourceDictionary = new ResourceDictionary(); foreach (object key in chart1.MergeResources.Keys) { if (key != typeof(System.Windows.Controls.Primitives.ScrollBar)) resourceDictionary.Add(key, chart1.MergeResources[key]);}// resourceDictionary.Add(typeof(System.Windows.Controls.Primitives.ScrollBar), FindResource("MyScrollBar");chart1.MergeResources = resourceDictionary;Regards, JuanC Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.