Using Controls and Components of Visual Studio in my application - c#

I'm currently trying to find out, if (also legally) I can use the components of Visual Studio in my applications. I don't mean the controls that are delivered to create my application, like a Button.
I mean the PropertyGrid, the Text Editor, etc, that VS also uses internally in the VS application itself.
The PropertyGrid would be especially interesting because the old winforms PropertyGrid can only be used with WindowsFormsHost, but using the old technolgy is also causing troubles when using windows with transparency, etc.
My questions are:
Am I allowed to do it?
Can you please provide me with an example of how to do that?

Related

Saving and loading different windows forms at run time in Visual Studio C#

I built my windows form app in visual studio and on desktop it looks fine. Although when I put it up on a projector we found the fonts etc were a bit small.
So what I want to do is using the designer design two versions of the app one the normal version I have now (Desktop Version) and another one with larger buttons and fonts (presentation version).
Then on runtime I want the user to be able to choose between the desktop and presentation versions of the app.
I'm a little unsure how to do this though, is it possible to save and load various different designs in VS?
Design your other form as a new one. Then simply call Hide() and Show() to switch between forms.
Another option is to export your design to some sort of data (xml, json, even plain text could work) and once form is resized and if size if greater than something, then swap styles of your controls.
Points of interest:
https://www.w3schools.com/xml/
encoding xml for deserialization in c#

Why my WinForms appear all congested in [Design] mode VS2015

I am developing my app on two different PCs, both having Windows 10 and Visual Studio 2015 installed using the same installers. When I open some of my WinForms in lab PC, the controls included in the WinForms appear all congested together (and even overlapping each other) making it impossible for me to modify the visuals. This happens only in "design mode". When i run the app, all forms appear correctly. Kindly see the difference in attached pic
This happens only for a few of the forms, not all. But despite comparing each and every form property (including "AutoScaleMode" which is set to "Font" for each form), i couldn't locate the cause. The other PC is showing all the forms 100% correctly in design mode.
What could be the possible reason/solution?
EDIT: Solution discussed here also has no effect in my case, whereas other posters said that their issue was resolved by changing the DPI-awareness of their PC.
This happens when your application is not responsive to different sizes of the display! you need to set the Anchor and Dock properties in winform.
Make it responsive but the best solution is to develop the application on WPF.
Thanks

Windows Forms Application C# Style

I am developing a Windows Form Application in Visual Studio 2008 (C#)
And I want to add Style to the items.
I have been investigating a few ideas about it but I have not found an example about how to do it. Is it really possible?
My app looks like:
But I really want to add more style in buttons, textboxs and other items I have:
My boss insists on using Visual Studio 2008.
To do this without purchasing anything else, you could create your own custom button and text box controls, either from scratch or as controls derived from the existing windows forms controls and then overriding OnPaint etc. Take a look at what's been done here:
http://dotnetrix.co.uk/button.htm
You could also investigate third party options.
Or, use WPF if that's a possibility as others have said. I'd push for WPF! If there's an existing WinForms Code base you can always host WPF Elements in WinForms. See:
Walkthrough: Hosting a Windows Presentation Foundation Control in Windows Forms
IF you wana to use Winforms than you have to buy this one for example:
http://devcomponents.com/
You have to bind the new assemblies in your application that is not a lot of work!
But better way do that with WPF
http://wpftutorial.net/DataGrid.html

Create Tabs and Drag/Drop Them In Application?

I currently have a program in .NET 3.5, written in Visual Studio C# using Windows Forms. I plan on rewriting this program from the ground up, its a very small and simple program, so its not that big of a feat.
With the new version of the program, I would like to give users the ability to add/remove tabs from a tabControl, as well as drag and drop them to re-arrange them in the order they like. I know they can not do this with Windows Form. Would I be able to do this if I create the program using WPF instead?
I also want to be able to load an webpage in the program, which would be AJAX based:
http://www.twitch.tv/chat/embed?channel=8wayrun&popout_chat=true
Would I be able to do all this with WPF, even though I cant do it in WF?
This project can help you: http://fabtab.codeplex.com

C# Control Name

I have two questions.
I am usinq Devexpress Winforms
What is the name of control of the
Visual studio toolbox.I wanna add a
control list like visual studi
toolbox.What is the name?
How can I add the flow chart to my
c# project?
For Dev Express, I would perhaps try something like the XtraNavBar:
Windows Side Bar Control
For a flow chart, I don't think Dev Express has a C# winforms flow chart right now.
See comments from Dev Express
#Deneme, The style of control that you see as the Visual Studio Toolbox is called 'an accordion control'. There is not one in the standard forms toolset, but it is not too difficult to build your own out of buttons & panels, and you can tailor it to your own needs and situation.
As for your second question about adding a flow chart, I am not aware of a single tool that you can drag and drop on to a form and set your users loose, but again, it should not be too difficult for you to create panels & buttons to create your own. Depending your needs you may be able to use some pieces of the Office Developers Toolkit to help you get there.

Categories