Thursday, October 10, 2013

The Visual Studio language support for VB has not been installed.

The Visual Studio language support for VB has not been installed.

I tried creating a new VB.Net Windows project and received the following error: Microsoft Visual Basic 2005 compiler could not be created. Please re-install Visual Studio.

To fix this issue, we can try to run the following command:

1.       Start->All programs->Visual Studio 2005->Visual Studio tools->open Visual Studio 2005 command prompt.

2.       Type devenv /resetskippkgs

Tuesday, October 8, 2013

Creating HTML Editor in C#.net Windows Application

Creating HTML Editor in C#.net Windows Application

1. Create a Windows Application Project and add a form

2. Add the Web Browser control to the Form

3.  Add a reference to mshtml
      using mshtml;

4. On Form Load add this code

           Editor.DocumentText = "<html><body><div></div></body></html>";
                doc = Editor.Document.DomDocument as IHTMLDocument2;
                doc.designMode = "On";

5. Basic editing operations can be performed using execCommand

eg: webBrowser.Document.ExecCommand("Bold", false, null);

6. To eanble editing use this code
 private void Editor_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
        {
            if (Editor.Version.Major >= 9)
            {
                Editor.Document.Write(Editor.DocumentText);
                doc.designMode = "On";
            }
        }