I want to create a control that lists items, uses a collection of text and images in each item, can be scrolled though, titles given if re-ordered and can be selected.
The best example of this would be Microsoft Outlook 2010 inbox view with right reading pane.
I was hoping there would be something in the toolbox I could re-arrange to fit by needs? or would I have to build something myself? which would be a good challenge, but as I've not done this before I would like to avoid if I can.
There is no .Net FW control out of the box for you. Either look for open source control / build on your own. FYI: I know this can be easily done in WPF world though.
also check out TreeView and Custom TreeView for basic starters..
It would be easy to re-create if you didn't need it to be ordered. For an off the shelf solution that you may be able to customize to your liking you should check out the DataTables plugin for jQuery. http://datatables.net/
Related
I want to display a dictionary on a form in an Outlook 2013 AddIn with VSTO in C#.
Actually I want to display two dictionaries, maybe a large dialog with 2 listbox or something to list the key value pairs, or two tabs each with a listbox or something to display one dict and one tab to display the other dict.
Anyone know the best way to accomplish this? I've tried all the methods I found online and none seem to work. I'm a bit stuck. Anyone know a good way to take achieve this? The dictionaries are created during the AddIn startup within the OutlookRibbon class. I can make them accessible from the outside if need be by making public properties if needed or just make the variables public.
This isn't part of my question, but I want to eventually perform CRUD operations on the dictionaries. If there is a better way to accomplish this than a form with buttons that will manually perform the operatins, I'm all ears. I am not using a database, this is a small addin and I need these dicts to be stored somewhere local and small. They have about 15-25 entries each so they are not big.
Any advice and short examples would be much appreciated and a huge help.
Thanks
I want to display a dictionary on a form in an Outlook 2013 AddIn with VSTO in C#.
I'd suggest using Outlook form regions in that case. See Creating Outlook Form Regions in MSDN for more information. It is up to you which controls to use on the form (depends on the business logic). .Net framework allows to use a lot of third party controls.
They have about 15-25 entries each so they are not big.
If you don't plan to store a huge amount of entries you may consider storing them in JSON or XML files.
I was trying to do something in visual studio the other day when I realized, if I could just make a form control to do it for me it would be allot easier, except I have no idea how to do that, I want the form control to have grids, each square having its own color property, if anyone knows how to make form controls, or even better knows how to make something like what I just described, I would be very happy :D
This MSDN article is a basic step by step outline of how you can write a customer control.
Unfortunatly MS has not figured out how to do avoid link rot -- so you may need to search creating custom winform controls to find this if you come in the future.
You are usually best servered by subclassing an existing control and customizing it.
You might also find some of the freely available winform control projects a gold-mine of useful info if you get serious about this.
However, it sounds likely what you should consider doing is creating a "User Control", this is usually simpler for a composite of few existing controls. This
article on the types of controls for winforms may be a useful overview for you.
Beyond that you really should use S/O if you are trying to resolve a specific problem you are having when you are coding. Google is a more appropriate tool for finding tutorials, etc.
1) Inside your project: Solution Explorer --> Right Click the .csproj --> Add UserControl
2) Drag and drop gridBox or any control you want into your custom control.
3) Check the ToolBox, your custom control should be located at the very first selection
Please forgive any silly words I may say. I am coming from a Actionscript3 background.
I am using "Visual C# 2010 Express".
I have a simple Form, in a WindowsForm Project, which currently holds just a Listbox. (Which I presume I will have to change to something else).
And I made myself a different display object (User Control) that is currently a Checkbox a title. (More will be added once I get over the hurdle below)
But I can't even get as far as Displaying the UserControl as a list.
I can't seem to find anywhere on the listbox to say "User this displayobject as the visual for listbox". I see tutorials saying "ItemsPanelTemplate" but I get error saying there is no such property for a Listbox.
I even tried making the Form in Design view and it is not in the list down the side of the GUI when I dragged as Listbox on screen.
Now I know how I would do this in pure Actionscript, but I dont know how to do this in Pure C#. Tutorials are not helping, as all the Microsoft site seems to try to give me is XAML (XML). and I am looking for C# code. So I have thrown in the towel and pleading for outside help.
Thank you for any help you can give.
It sounds like you want a list of items, each with a CheckBox and some descriptive text. Try using the CheckedListBox control. MSDN link.
This question also answers the question of how to do custom image drawing for each item in a ListBox. It may be helpful.
Edit after clarification:
Try embedding the UserControl in a ListView, rather than a ListBox.
References on embedding controls in ListViews:
C# listview - embedding controls
Adding button into a Listview in WinForms
You could also use a list of Panels, with each Panel hosting a UserControl.
C# List of Panels
But the real answer, as seen in the question's comments, is that Winforms doesn't have a convenient way to do this. This is a task much better suited to WPF.
You may check out freeware component Better ListView Express from ComponentOwl. It supports simple Details view without columns, two and three-state checkboxes, images and more...
They also offers full version with even more nice features like hierarchical and multi-line items.
my question is very simple. I am building an app(WPF CSharp) and I need user to give me paths that my app is going to use. Previously I added textboxes to show pathways, however, later I decided that it would be cool to use a Win 7 style Explorer navigation bar, which is a Breadcrumb bar. I found a great open source component for it here (http://www.codeproject.com/KB/tree/WPFBreadcrumbBar.aspx) however, I could not use it in my app. I added references both to Toolbox section and Project>References section. I can also add the control to my WPF window from Toolbox, yet I could not figure out how to fill it, how to change and show items in it etc. With respect to component author, I think article on Codeproject is not very 'understandable'(XAML? I want C# code please) and also PopulateItems event, for instance, did not work for me. So, if someone give me a basic example on how to add items to this bar easily, change items, or shortly, shows me how to make it work, I will appreciate for that,
Thanks.
I Guess it depends on how you want to present it. If you want to use a tab control to simulate the functionality you could go this route:
http://www.wpfblogger.com/post/BreadCrumb-TabControl-Style-for-WPF-40.aspx
I want to use a treeview control in my asp.net project and when i drag and drop anything, it should update database. and there should be sort, when I change the sort when I drag and drop, the order column should be changed at the database.
(It is clear that treeview will get the items from database.)
I would search for examples of this via google to see what options are available with the standard .NET components, and 3rd party components (commercially purchased and jquery style plugins) See which one best fits your need and have a go at implemneting what you need. If you have further problems, let us know.