There are 0 results on SO for CssHierarchyControl and 3 irrelevant results on Google for CssHierarchyControl C#.
What is this control? How does it differ from a ComboBox?
From the tooltips from hovering on each of the controls: ComboBox is at v4.5.0.0, whereas CssHierarchyControl states v11.0.0.0.
The CssHierachyControl is on my machine as well. Looking under the "Choose Items" context menu on the toolbox I see it listed as part of the Microsoft.TeamFoundation.Client namespace in the Microsoft.TeamFoundation.Client assembly. It is version 11.0.0.0 as well, which matches the version number of Visual Studio 2012, which is 11.
Looking at the class in dotPeek it does inherit from System.Windows.Forms.ComboBox so it is a combo box.
It is not listed as part of the Microsoft.TeamFoundation.Client namespace so it is not meant for public consumption so you should remove it from your tools list since there is no reason to ever use it.
Related
Visual Studio provides a helpful tool window, which allows investigating values of WPF elements in the runtime:
Is there a way to name instances of eg. styles so that I can identify, which specific style got applied to a property of some element?
I'd expect something like System.Windows.Style (name: Abcd)
I tried adding x:Name and x:Uid, but neither worked in the expected way.
I would like to set the default font of the form components from Microsoft Sans Serif to MS Outlook
I can change the font every time I put a new control on the form but its time consuming. I didn't find any help or options for it in the Visual Studio 2012.
How can I change the default font for any added control?
Many Controls you add to a Form, default to some of the Form's properties. That includes the Font of the Form as well as its BackColor. This comes handy if you want to use, say Consolas,10 for all Controls..
Here is MSDN on these 'ambient properties'..:
An ambient property is a property on a control that, if not set, is
retrieved from the parent control. If the control does not have a
parent and the property is not set, the control tries to find the
value of the ambient property through the Site property. If the
control is not sited, the site does not support ambient properties, or
the property is not set on the AmbientProperties object, the Control
uses its own default values. Some objects derived from the Control
class might set the property even if you do not. For example, the Form
class always sets the ForeColor and BackColor properties.
TextBoxes and some other Controls don't get the Backcolor, though.
Note: Changing the Form's font will change those 'inherited' Fonts of all Controls on the Form, including TextBoxes, Lists etc. Those properties you have set directly will not change, though.
So: If you want to use varying Fonts, get the Form's Font right first and try to avoid an uncontrolled mix of default and set values! (You can check which you have set in the From.Designer.cs file..)
I have the same question which bothers me very much, and I can not find the solution for months. Today I finally find a possible solution using my limited concepts on c#.
Back to the topic, just add the 2 lines below in the file "form1.designer.cs", which is in the installation directory of visual studio. My visual studio 2010 have the directory like this :
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ProjectTemplatesCache\CSharp\Windows\1033\WindowsApplication.zip
using System.Drawing; ///this line on top of all
this.Font = new Font("Arial", 16); ///this line in the InitializeComponent()
There are some side effects because some properties rely on the font size, such as the form size will grow because of the Form's AutoScaleMode, default size of button/textbox would be not suitable as you know... But it is not a big issue. A nice programmer could solve this kind of issue by himself.
In this manner you could change anything, such as button/lable font, color... All depend on your imagination.
This is my first post. I hope it helps some guys like me.
The easiest way i found is find and replace feature.
Just double click an item lets say a command button then inside the code hit Ctrl +F to find "font". after you find which default or current font is in use, now broaden the Find to Find and Replace and now replace with your desired font.
I downloaded a project off codeproject and was messing around with it (I am more an asp.net developer) when I noticed these overlay icons...the lock one on the label is really interesting as when I right click the control is unlocked yet all the properties are grayed out. When I add a new label I do not have that lock icon when I select it. What is this? Also what is the double boxes icon (the other 8 that are highlighted)?
The Winforms designer observes standard .NET accessibility keywords. The Modifiers keyword for a control is what counts here. That sets the access keyword for the member variable. The default for a C# project is private, for a VB.NET project it is Friend. VB.NET is more friendly about it.
That matters when you derive a form from a base form, Project + Add New Item, Windows Forms node, Inherited Form item template. The derived form will have the controls of the base form but they cannot be changed if their Modifiers property is Private. The designer makes it obvious by displaying the lock icon. And by displaying the properties of the control in gray text.
Normally this means that the controls are defined in the base control and so you cannot change them in the derived control (so they are all locked).
I'm currently using the Extended WPF Toolkit and from that i'm using the Propertybox. This box displays all properties of a bound element. While this works great, there is one problem. I'm using Nullable... so it does not display this enum correctly (it just gives a textbox). If i changed the enum to a normal enum (not nullable), then it displays the items correctly in a combobox.
To solve this, i tried the IItemsSource interface as described in the documentation, but this won't allow me to add a "null" value either.
I know i could solve this by adding a fake "null" value to my enumlist, but i would like to avoid this. Does anyone here know how i could make my nullable display correctly?
Kind regards
Tom
Control documentation:
https://wpftoolkit.codeplex.com/wikipage?title=PropertyGrid
UPDATE SOLUTION:
I "solved" it by using a different control. http://www.codeproject.com/Articles/87715/Native-WPF-4-PropertyGrid. This grid supports it out of the box.
SOLUTION: I "solved" it by using a different control. https://github.com/xceedsoftware/wpftoolkit. This grid supports Nullable out of the box, and has some filtering functions for the properties you want to display that are not included in the Community Edition of the WPF Toolkit.
Update 2020: Added link to current webpage.
I'm after a link to online Microsoft reference doco for the XAML elements/attributes that are used in WPF XAML?
thanks
Such list would be pointless, because most tags can be used only in certain context.
All elements inherit from FrameworkElement class (though there are many more non-element tags, but these are usually used in specific contexts only), so you can look them up from there (though some of the children are abstract). Each tag's class page also contains information which tags it can contain.
Btw, IntelliSense is very helpful in this case. Just hit Ctrl + Shift and you get list of all the tags you can use in the context.
Also, you may want to check Expression Blend, it has siginificantly better XAML designer than Visual Studio (and it offers much more elements on the palette). And it works well together with Visual Studio (as long as you have corresponding version - Expression 3 vs. VS 2008 / Expression 4 vs. VS 2010).