How do I set / change the item selection color in XAML for a WinRT GridView control? I've tried looking around, is there also a procedure for doing it visually on Blend for VS11?
I've looked at GridView.ItemContainerStyle tag and I couldn't find much help online.
There was an earlier question that was asked about disabling tap visualization in a GridView that might help you.
Extracting the style of a GridViewItem is not available on the GridView itself, so if you want to do it yourself - you need to put a GridViewItem control separately in some page/user control and use the designer tool to edit the template. Or you can just use mine from that other question. I think what you would need to change is the use of the ListViewItemHighlightBrush in that template.
Related
Is there any way to replace one control with another?
I have a library from a vendor that uses a TextBox and I would like to change it to a RichTextBox.
Can I maybe set up a Style with a TargetType=TextBox and assign it to RichTextBox?
I do have access to the vendor code, but putting the replacement in the parents Resources would be much easier than updating their code each time they have a new release.
Is this even possible?
Thanks!
Without knowing more about the control(s) in question, I would recommend using the "Edit Template > Edit a copy" in VS or Blend and changing the TextBox to a RichTextBox. This should leave the rest of the template intact.
If that doesn't work, please post the ControlTemplate and/or Style code you used, and maybe a screenshot of the vendor control.
My situation is this:
We have a WPF application using a WPF ribbon(http://msdn.microsoft.com/en-us/library/ff799534(v=vs.100).aspx). We have a scenario where we use both the RibbonComboBox as well as "normal" ComboBox in the ribbon, where the ComboBox is referenced via a ControlTemplate.
The issue we have, is that the default ComboBox style is different to the RibbonComboBox style, which is a bit of an eyesore. How can we determine what the Style / ControlTemplate of the RibbonComboBox is so that we can apply the same / something similar to the "normal" ComboBox, without having to go and scratch around in the MS code.
If gone through MSDN after MSDN article and I've scoured stackoverflow and nowhere can I find this info?
Thanks!
Use the following link for getting style of your RibbonComboBox using Blend.
http://www.jeff.wilcox.name/2010/08/using-blend-to-find-default-style-xaml/
I'm trying to style some wpf user controls to make them look the same i have in my web application. I found some really great example for every control i need except for sliders and radio buttons.
Here is how they should look like:
Slider:
Radio Button:
I know i should create some ControlTemplate but i don't really know where to start...
If you can provide a complete example it would be perfect, but i guess that even some good deep advise would fit my needs.
Thank you 1000!
I have style sample here. It renders this:
I would start with Control Styles and Templates on MSDN pages. There are examples for most controls which give a good overview of how the control template works. Also you can extract/download the original control template and try to make your changes to it. Download default control templates
P.S. Actually the slider example on the first link resembles the one you describe.
Try using Expression Blend.
Learn Expression
and specifically this video: Creating ControlTemplates.
Expression Blend is something like a XAML design application - you can size, colour, adjust fill and stroke etc on all the elements in a control. It takes a little while to get used to, but you will be able to design controls with a graphical UI and Expression will provide you with the appropriate XAML to use in your project.
I am trying to develop a custom radio button that looks like a two-option button control that looks somewhat as shown below with toggling of highlighted state. Not sure where to start.
Is there any such controls already available that I can use.
OK, here is a brief overview of what you will need to do ...
Firstly, you will need to change the ControlTemplate for the existing RadioButton control. There are lots of tutorials available that describe this,, for example this one.
Replace the standard template with some suitable markup for your illustration above. Perhaps a two column Grid?
Within each Grid cell add a Rectangle, one behind Option1, and the other behind Option2
Use the VisualStateManager to change the Fill property of each Rectangle based on the controls current VisualState. i.e. when Pressed toggle the background colours.
The steps above should help you achieve your goal. Please read the linked web pages and the Silverlight documentation. If you are still struggling after that,, come back and ask another question.
I am creating Windows Forms application using C# .NET in Visual Studio 2010.
I populate data to a ListView from a Excel file. Now I wanted to select a particular cell or list of adjacent cells vertically. I have attached a sample image here:
I wanted do something like this inside a ListView.
I need suggestion from you to understand the methodology (like what are events I should use, what properties of the ListView I should change to do this, etc.)
I appreciate any help you can give.
A ListView control is a poor substitute for a grid control. You can simulate this by tinkering with ListViewItem.UseItemStyleForSubItems = false, the sub-item's BackColor property and ListView.HitTest() but that isn't any fun. Consider DataGridView or one of the many spreadsheet and grid controls available from 3rd party vendors.