I am new to VSTO and C# and have a question regarding split buttons. I am trying to create a split button "Insert Slide" Much like the default Microsoft Created button "New Slide".
If someone clicks on the button, it inserts a blank slide with my custom template (this part works fine for me). If I click the drop down, I want to see several categories (ex: Slide Group A, Slide Group B, etc). In each of those categories will be a series of slides (Slide Group A has a bunch of different slide templates). I had some pictures created for how it would like to look but I can't post pictures yet, so I will do my best to describe them. If you refer to the New Slide dropdown, I would like it to look like that.
I would like to dynamically build the menu such that all the group names are created based on the folder names in a specified directory, and so that the slides to insert are pulled from within that particular folder. TIf you refer to the New Slide dropdown, there would be headers (like "Office THeme" but with my folder names instead) and then a series of slides underneath which are all the slides within tha folder.
If someone could point me in the right direction as to what I would have to do to make this work (I don't need you to write out the code for me; if you could just give me a high level sense of what I would need to do to implement this) I would appreciate it. Also if you could recommend a VSTO resource for Powerpoint, that would be great (I have been looking all over and have found resources for everything but Powerpoint!).
Please let me know if this is unclear; I can provide the mock up pictures via email in case.
Thanks,
Dan
You can use gallery controls instead of split buttons. This control has callbacks like getItemImage, getItemLabel, GetItemCount which would help you to build your menu dynamically.
Here is an example I found which is using Excel 2007, you could follow this for PowerPoint
Related
In short, im creating a Visual Studio extension in c# that enables non-automation testers to create automation scripts for web based solutions (using selenium).
We've created a template already for users that lays out the project file structure (test runners etc) and im using windows forms toolbox controls to create the dialogue windows where they will enter things like URls, Xpaths, page names etc etc
My question is this;
How on earth do i go about creating .CS files dynamically based on their inputs in these toolbox windows?
The simplest (he says) window i have is one that simply allows them to enter a URl and a webpage name. When they click the 'ok' button on this window, it should create a new .CS file with the webpage name as the class name, the url as a string that the webdriver can use to kick off the test and a few other bits and pieces as a template for them to start adding web elements to.
Any guidance would be greatly appreciated, there seems to be precious little around the web about creating VS extensions!
You got a few options here.
Typically, most people would do this by implementing a custom project item template, along with a custom IWizard based wizard associated with your template.
If you are displaying a modal UI from your IWizard.RunStarted, you can simply populate the ReplacementsDictionary with the text gleaned from your custom UI, which would then be swapped for the tokens in your templatized .cs file.
Or you could programmatically add code to the file after it was generated and added to the project (admittedly a much uglier and more difficult to code).
And finally, you could just generate the file in the project directory, and programmatically add it after the fact.
There's a number of old blog articles from the archived VSX Arcana blog that you might also find helpful.
I'm working on converting an old VBA project into a C# VSTO. I know a lot of the code has to go out of the window, but I was hoping to still use the layout and objects that had been embeded into the sheet. Examples of the objects include controlbuttons, labels, images, etc.
All of these persist nicely when I choose the document as a template when making a new project. I run into the problem in that I can't seem to select or reference any of these objects. For example there's a button in the middle of a sheet. If I open the sheet in VS2012, I can see the button. I can even "highlight" it but not select it. If I right-click on the button to pull up the properties, it will bring up the properties for the sheet, not the button. I can't resize them or move them around (not that I want to).
I also can't seem to reference them in code, ie ...Sheet1.ControlButton1... or ...Sheet1.OleObject(n)... will never refer to anything. If I open up the workbook directly from the solution folder and click on the same control I can see properties, and the formula bar in Excel reads =EMBED("Forms.CommandButton.1","").
I've also not been able to loop through all the OleObjects and just display their names. Clearly where ever the collection is that is storing these I can't find it.
Try the Workbook.Shapes collection
Edited as per the comments below. This works:
Globals.ThisWorkbook.Worksheets(1).OLEObjects("CommandButton1");
I am scanning a log file, the log file contains different component, component contain sub component & the sub component contains sub-sub component. There is parent child relationship with 3 levels.
The log files can be many and log file size goes round about 7MB.
Currently I am using nodeXL to represent the data in a graphical representation format.
For accomplishing this task, i am using C# Windows application with nodeXL.However I am not that satisfied with view & graphical display results of nodeXL for this case.
Need to have an attractive graphical display of the information I have.
Can anyone suggest any plugin tool or other way to accomplish this task.
Thanks in advance
Note: I am not sure the #tag to put in for this question. Pls edit the #tag section as you find out appropriate.
You could use GraphViz. I used it in a couple of projects now, mostly for debugging purposes. The format, in which you have to specify your graphs is really simple to write/generate. Furthermore you can modify the style of your nodes and edges as you like. The gallery on the provided website gives some examples. (google images for "graphviz examples" and you will see whats possible)
My ultimate goal is to allow a user to select what directories they want as a checkbox type thing. Can I display a drill down directory structure with checkboxes next to each folder using this control or should I got a different route?
Edit: More Information.
I have a Windows Form application in Visual Studio using c#.
It is to allow myself and some select friends automatically backup folders to amazon s3 on a daily basis.
I need to figure out how to display a computers directory structure which you can drill down into and check a box next to any folder you want.
That way the app will only backup folders you choose.
A CheckBoxList seems like the right way to go but I can't figure out how to make it a drilldown list. It seems to only display a list of items. What is another control I could try or another method I could explore?
if you need to show a hierarchy just use a TreeView with checkboxes.
you are not telling if you are in Windows Forms, WPF, ASP.NET, MVC etc... still there should be such "checkboxable" TreeView in all these platforms.
A CheckedListBox displays a flat structure. A TreeView would be more appropriate to present a nested directory structure.
I want to write a GUI seating application that allows users to draw and annotate simple "maps" of seating areas.
The end result would probably look something a little like Visio, but specifically for manipulating my "seating" data model rather than producing files.
In Java-land, there's the Graphical Editing Framework (GEF) -- is there anything like this in the .NET space? Should I just use System.Drawing.Drawing2D primitives and handle it all myself?
Here is product from Nevron. It is paid but doing it all yourself will take lot of time and effort.
Open Diagram and EasyDiagram.net are available at Codeplex. Be sure to download and look into their code.
There is Netron Library for diagramming. It is open source and uses GDI+.
Check out NShape. It is an open source diagramming framework written in C# and quite powerful. Its controls are WinForms controls but you can also use it for WPF.
You might consider using the DSL Toolkit from the Visual Studio SDK. It allows you to create a graphical DSL designer by first creating a domain model, and then creating the graphical notation that will allow users to create or edit instances of that model.
You may very well be able to create a graphical notation that looks like a seating area. This would allow your users to not only "diagram", but to produce a file containing a filled-in domain model of what was diagrammed.
Check out our MetaDraw component - www.MetaDraw.com
MetaDraw is designed to make applications like this easy.
MetaDraw will support a background image and an annotation layer
You can put users into a variety of editing modes - Lines, Curves, Text, Shapes, etc.
Every drawn element is distinct - just like in Visio, so you can allow users to select objects and move them around or resize them. Every object can have multiple hidden tags ( like seat numbers or database record pointers ). You can recognize which objects users select ( for instance take some action when user clicks seat 22 ) . You can dynamically modify propertie by code - such as searching for seat 22 and changing it's fill color. Of course you can also scroll, zoom, print, save to a variety of formats and more.