Question

I've been given a folder with many .cs files and a .sln to work on with the express interest of designing a GUI for the entire project. The only problem is, I don't know how.

I have both Visual Studio 2010 and SharpDevelop 4.4 at my disposal; though I'd like to learn both evenly if possible, because I like open-source IDEs, but value experience in Visual Studio as well.

I can't find any information on how to enable design mode in this situation because of how narrow my experience is with the tools; You see, I know to right-click on a .cs file in order to view its code or design in Visual Studio 2010... but that isn't available here. The only item I can see is "view code", which is not what I'm trying to do.

If I can't enable the form, I'm wondering if I can just... create a new one? Since one does not exist?

Thank you for your help.

EDIT: A screenshot of what I see (blurred for security)enter image description here

Was it helpful?

Solution

Abstract answer

The designer only makes sense for some types of files. For example, Windows Forms designer exists for classes that inherit System.Windows.Forms.Control, and when the relevant attributes for that file are set in the project.

Practical answer

  • Make sure you have a project that allows Forms (like "Windows Forms Application" or "Windows Forms Control Library"), create one if needed.
  • In project tree, right-click on the project and use some "add new ..." in the context menu.
  • There, choose "Form" or "Control" depending on your intent. It should create and configure what's needed, and you'll be able to use the designer.

In Visual Studio you can switch between text and designer with a shortcut key (F7, Shift-F7) or context menu. In sharpdevelop use the "Source" and "Design" tabs.

OTHER TIPS

In SharpDevelop if there is a designer available for the file then you can open the designer by:

  1. Open the file into the text editor.
  2. Click the Design tab at the bottom of the text editor.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top