I'm programming an application in WPF using the Ribbon menu, part of the requirements for the application is that I need a commands tab, but this tab should be visible at all times and depending on the active document I would enable/disable the appropriate commands.
My question is, does anyone know a way to split the ribbon menu so that the commands tab is always visible on the right side of the menu?
I'm sure there's an easy answer for this, I just haven't found it yet.
Thanks & Regards!
It's not within the functionality of the ribbon. Why not build a grid with 2 columns, and have the ribbon in the left pane and the custom control on the right? Then you can just style the custom control to match the ribbon.
You can get the source code for the ribbon from CodePlex so you would be able to get the exact style.
It might not be what you wanted to hear, but I think it would be ideal.
Related
Currently I am working on a project in which a combo box determines which panel is shown. This gets very messy since all the panels are on top of each other and it becomes very hard to determine what is what.
I was wondering if there is anything that can help me in Visual Studio 2013 to solve this.
You could use Document Outline window which provides an outline view of elements present on the form.
On the View menu in Visual Studio, click Other Windows, and then click Document Outline. The Document Outline window will open.
There is another link which explains How to: Layer Objects on Windows Forms.
By layering you could manipulate their z-order of control at design view. There is option to change the Order of control either Send To Back or Bring To Front.
MSDN reference also explains how you could manipulate ordering programmatically.
I want to add a custom menu item to the menu that appears when a user selects some text and right clicks. I searched a lot but did not get any answer. Maybe I did not put in the right keyword.
Is it possible to do this?
If this is possible, I want to do this for all applications in windows whenever the user selects text. Is there a universal way to do it or will have to write code specific to the application?
I am using C#.
I don't think you can do that universally in all windows apps. But it is certainly possible to do in your own app using a popup menu.
I've also tried a way to add an item to the standard ContextMenu and failed. From my point of view, the only solution is to set the TextBox's ContextMenuStrip property to an instance of the ContextMenuStrip class and implement both standard and your custom menu items. It is easy to mimic standard operation, since the TextBox class provides all required methods: Cut, Copy, Paste, SelectAll.
The universal way is basically writing a "custom shell extension".
There is an article on CodeProject about how to do this.
http://www.codeproject.com/Articles/174369/How-to-Write-Windows-Shell-Extension-with-NET-Lang
The other way to do this is to build this into your application. For example you might have a text editor and you'll want to highlight a word and get a definition for that word. To do this you'll need to implement a context menu.
The VERY BASIC concept is detailed over on CodeReview.StackExchange.
https://codereview.stackexchange.com/questions/3983/c-programatically-creating-context-menu
i am building a C# application, i have explored its all controls but i cant find the left menu style which i usually see in software applications for example visual studio, i am attaching the image of what i need.
Please let me know how can i use it in my forms. I have used a tab menu control in visual studio, but it is not what i required, its tabs are vertical, but i want the exact like i shown in attachment. I think it requires some reference to add.
I don't think that control is available, which means you would have to make one yourself. Here is a link from someone that made one. I haven't tried it: Visual Studios "My Project" Tab Control
There is no such a control in the ToolBox by default. But you could create one for you.
Creat a user controller.
Added a SplitContainer and set Dock.Fill.
Add a FlowLayoutPanel to the Left panel. Add buttons or labels as you wish and implement the click event.
I am currently in the process of improving my options dialog for a winforms application. At the moment I am using a tab control.
I would like to create a form/dialog for settings that is similar to Visual Studio's. How is this done? I can see a treeview like control on the left hand side but what control are they using to display each of the options pages, it doesn't appear to be a tab control. I would like to be able to build the controls for each of the settings at design time.
Thanks.
They look to me like UserControls. I can't say how exactly they implement it, but it would be simple enough to build a UserControl for each option type and swap out the current control when the tree view selection changes. In your designer you would simply have the TreeView and a parent panel to host the UserControls. At runtime you would perform the swap.
Is there a standard .NET control for what I call "a two pane picker", or do I have to code it by hand?
Two pane picker:
The left pane has a list of items.
The user can pick items from the left pane to put them in the right pane using buttons between the two panes.
Picked items in the right pane can be reordered with buttons.
An example of the "two pane picker" can be found by right clicking the Quick Access toolbar in Word 2007 and clicking "Customize Quick Access Toolbar..."
Note: If applicable, VB.NET answers preferred, but C# answers are acceptable too.
There's no standard control for that. Sounds like an excellent case for a custom user/composite control.
There are no .NET Framework controls which create the functionality you describe, however it is fairly easy to implement. Here's some examples I was able to find (not tested):
https://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=1253&lngWId=10
http://www.dotnetspider.com/resources/18324-Content-Transfer-between-Two-listboxes.aspx
http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/2082caa0-5ece-4ad8-8077-8c7170fa6f9f
There is no standard picker. You have to build it yourself or find a third party control.
I don't know of anything like that, but its trivial to implement with two ListBoxes and some buttons. When 'Add' is clicked, do .Remove with the item at the selectedIndex from the left and .Add it to the ListBox on the right.