How to edit Expression Blend selected control part? - xaml

I am trying to edit a specific control part within a custom TabItem Template. In this case, it's the TemplateBottomSelected control part.
I'm having an issue where I cannot seem to view or edit any control parts within the template editor except the default TemplateTopSelected. Here's a screenshot of what I'm talking about:
Even though I'm selecting the "TemplateBottomSelected" grid, the only thing I can see is the template for the TemplateTopSelected item.
How the heck do I edit the other control parts within the template using the editor?
Thanks!

that's because these templates are either collapsed or the opacity of them is set to 0. :)
you can use the eye toggle button to only show the one you want to modify at design time, set the visibility to visible, do your changes, and reset it to collapsed.
please let me know if you need more info.

Related

Recommended approach to display Dropdown in CommandBar

What is recommended approach to display a Dropdown in CommandBar?
There is no build-in support to display a dropdown in CommandBar. I know two ways to work around that.
Label + Dropdown. It's the simplest implementation but I have to take care of for/aria-labelledby attribute, maybe ms-Dropdown-label class. I don't feel it logically correct as we treat label and dropdown separately from component view. That's why I tried the second approach below.
Dropdown + styles. We can get label associated with a dropdown for free. The problem is the layout. Default display for dropdown is 'block' and I have to adjust that as well as padding, default font size etc.
Is there an easy way to achieve it? Or does office-ui-fabric have plan to support dropdown in CommandBar. I feel it a common UI everywhere.
You might look at the Office single line ribbon for inspiration. They use the same overflow sets and resize groups as the command bar, and extensively use dropdowns and comboboxes.
I'd probably suggest label + dropdown so that you have a nice encapsolated control you can render inside of the command bar.

How can you add an image to a listbox in VB?

I am wanting to add an image to the top or background of a listbox. I would like it to be visible on the screen, but more importantly is that it prints. Can someone help me with the code for this. I tried to see if you could add it through properties and don't see that option. I need the listbox not listview. Also I was wondering if it could be added as a string and the file referenced at the top of the listbox (when you right click the little arrow and click edit options? Can someone please help. I am working on a project and still very new at this.
You need to create a custom ListBox class and add the ability to draw a custom background by overriding the OnPaint event, like on:
Source: http://www.vbforums.com/showthread.php?416784-2005-ListBox-Background-Image

Removing item level mouseover effect in SharePoint 2010

I am trying to remove the hover effect that brings up the checkbox next to the row item in SharePoint 2010 list item rows. Is there any settings that can make this happen? I would like to keep away from having to tinker with the CSS and javascripts. Please see illustration below. Thank you.
There are no settings for that sort of thing - the selection check box is a default behavior. You are going to have to modify the CSS, for that.
Use SharePoint Designer (Available Here]1) to help determine whitch CSS elements control that behavior, and make a custom style sheet to override it.
You can accomplish this by going to the Modify View option of your list and unchecking the Allow Individual Item Checkboxes under Tabular View options.
Note: If you are using a Web Part to view it you might have to set the view again for the changes to reflect.

How to always display a control on the currently active tab of a TabControl?

I have a tab control with two tabs. Both tabs have controls which are unique to them, but there is one control which I would like to always appear on whichever tab is currently active.
I figure I just need to add some code to TabControl1_SelectedIndexChanged().
I tried
MyControl.Parent = TabControl1.TabPages(
TabControl1.TabPages.IndexOf(TabControl1.SelectedTab))
MyControl.Parent.Update() ' is this necessary?
and I also tried
TabControl1.TabPages(
TabControl1.TabPages.IndexOf(TabControl1.SelectedTab)).Controls.Add(SeMyControl)
but neither worked (the control moved once, but when I went back to the original tab, the control did not appear there.
googling found someone suggesting
TabControl1.TabPages(TabControl1.TabIndex).Controls.Add(MyControl)
but that looks dodgy as the control is never removed from the old tab, so repeated switching would probably add the control multiple times.
I feel that I am close, but not quite ... how do I do it?
No, that works fine since Controls.Add() changes the Parent property. Which automatically removes it from the tab page it was on before. A control instance can only have one parent.
The more straight-forward approach is to simply not put the control on a tab page but leave it parented to the form which a lower Z-order so it is always on top of the tab control. The only problem with that is that the designer will hassle you. It automatically sucks the control into the tab page when you move it on top of the tab control. One trick to fix that is to leave it off the tab control and change its Location property in the form constructor.
Using your second code snippet that you are concerned about because it doesn't remove it from the original tab, why not just remove it from the original tab before you add it to the new tab?
Maybe something like: TabControl1.TabPages(TabControl1.TabIndex).Controls.Remove(MyControl)

Visual Basic & Context Menu

Is there a way to add a Header to the popup menu? I don't find a property for this.
You could also simulate a header on the context menu by putting the information you want to display in the header as the first item in the context menu. Put a separator (or perhaps two) underneath it and put no code behind it.
That visually separates the item and users will learn pretty quick that clicking the first item doesn't do anything.
This may not work in your situation, but whenever I needed to show a context menu off of a grid row that wasn't the current/highlighted row, I made that row the current row first, then showed the menu. That would eliminate the need for a header on the menu. I assume you're showing the context menu if the user right clicks on the row. Well before showing the context menu, make sure that row is current and highlighted.
Do as Corin says, but disable the first item as well. If you disable it, that should remove confusion entirely.