This project is read-only.

Host A Code Editor On A Windows Form

Jul 24, 2010 at 4:33 PM
Edited Jul 24, 2010 at 4:35 PM

Is it possible to host a code editor on a windows form launched by a Managed Menu Extension?  In particular, I'd like to host a C# editor (in place of a multi-line text box control) on the surface of the windows form lauched by clicking on a menu added with MME.  I'm new to Visual Studio Extensibility and would dearly like an example, if possible.

Coordinator
Aug 17, 2010 at 8:41 PM
Well you CAN show a WinForm from a Managed Menu Extension so if you can show the code editor your are talking about ona normal WinForm you can also launch it from a Managed Menu Extension. But I am not sure what you mean. Is the Code Editor you are talking about a Visual Studio Code Editor ? I do not know if you can host that in a windows form. But that is also beyond the current scope of this project.
Aug 17, 2010 at 11:14 PM

Yes, I’d like to host a visual studio editor window in a windows form launched from a managed menu extension.  If you have any knowledge of how to do this or any ideas about how one would go about it, I’d really like to know.

From: jern [mailto:notifications@codeplex.com]
Sent: Tuesday, August 17, 2010 3:42 PM
To: wburchard@insightbb.com
Subject: Re: Host A Code Editor On A Windows Form [mme:221234]

From: jern

Well you CAN show a WinForm from a Managed Menu Extension so if you can show the code editor your are talking about ona normal WinForm you can also launch it from a Managed Menu Extension. But I am not sure what you mean. Is the Code Editor you are talking about a Visual Studio Code Editor ? I do not know if you can host that in a windows form. But that is also beyond the current scope of this project.

Read the full discussion online.

To add a post to this discussion, reply to this email (mme@discussions.codeplex.com)

To start a new discussion for this project, email mme@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com






=======
Email scanned by PC Tools - No viruses or spyware found.
(Email Guard: 7.0.0.18, Virus/Spyware Database: 6.15660)
http://www.pctools.com
=======






=======
Email scanned by PC Tools - No viruses or spyware found.
(Email Guard: 7.0.0.18, Virus/Spyware Database: 6.15660)
http://www.pctools.com
=======
Coordinator
Aug 21, 2010 at 7:34 AM

Well, I have never tried it. The next time I work on the project I will give it a go. But it will not be for the next few days. Is the hosting itself your problem or is it to get access to some stuff in your Visual Studio Solution - like a specific code file ?

Aug 22, 2010 at 11:20 PM

The hosting is what I don’t know how to do. I can get to the files in the solution, but I’d like to be able to host a Visual Studio Editor window in the addin / extension windows form. I’m building a wizard and I’d like for the user to be able to enter a LINQ statement and let the editor window provide syntax coloring, etc. I’ve figured out how to dynamically wrap up the LINQ statement, compile it, execute it, and display the results. (The results will drive the output of the wizard.)






=======
Email scanned by PC Tools - No viruses or spyware found.
(Email Guard: 7.0.0.18, Virus/Spyware Database: 6.15700)
http://www.pctools.com
=======
Coordinator
Aug 23, 2010 at 7:20 PM

Still haven't found the time to test this myself. But in the meantime I found this link: http://social.msdn.microsoft.com/Forums/en-US/vsx/thread/208555bf-da67-4a7c-a5bc-7ccb89a58404

Perhaps that is part of what you are looking for. Providing intellisense in a WinForm. Don't know about the syntax coloring though.

Aug 27, 2010 at 9:07 PM

Thank you, jern. This is a great step closer to what I’d ultimately like to achieve.






=======
Email scanned by PC Tools - No viruses or spyware found.
(Email Guard: 7.0.0.18, Virus/Spyware Database: 6.15750)
http://www.pctools.com
=======
Nov 5, 2010 at 2:59 AM

This tool works great. However, can it be used to add right click menus to the code editor window as well?

Coordinator
Nov 5, 2010 at 2:53 PM

It sure can. But only if you get the latest sourcecode and compile it yourself. I haven't had the time to release it. But I added that functionality back in July.

Mar 3, 2011 at 3:04 PM

Can you show me how you would fire up a  windows form from clicking on menu item? I need to add a class library (dll)  into C:\ProgramData\MME to get this working but a form is a exe and thats not working.

Do i have to use reflection to open up the form or use some events to call the creation of the form?

Coordinator
Mar 3, 2011 at 8:23 PM

That is actually easy, and just basic .NET no need to use reflection. A Form is just a .NET class like any other. You can add a Form to a ClassLibrary just as easily as adding it to a normal Windows Forms project. Then just create the form and call Show() in the click event of the menu item. Also no problem to show a WPF window.