Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# Windows WinForm
Hi
I m using Visual Studio 2008 framework 3.0,

I have created a editor in windows form with web browser control and adding html tags to it and saving to database.... and i m able edit text and enter text in web browser control in Windows XP, In windows 7 i m unable to enter single letter into it.. please help me to over come this problem...
Posted 11-Oct-11 0:48am
Edited 11-Oct-11 1:45am
Comments
SAKryukov at 11-Oct-11 11:26am
   
Who knows where did you screw up? Make a code sample (as small as you can) manifesting your problem and post it using "Improve question".
--SA
fgrimm at 19-Oct-11 19:23pm
   
another source of the problem might be an other version of internet explorer the setting for active-x ....
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

i have got the solution

A Windows Forms based text editor with HTML output[^]

Need to add code in the editor.cs and you can find code in the comments in the above link.

private void theBrowser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
// Existing Code here....
 
         HTMLDocument HTMLDocument =
               (HTMLDocument)doc;
 
         ((HTMLDocumentEvents2_Event)HTMLDocument).onkeypress += new
 
               HTMLDocumentEvents2_onkeypressEventHandler(this.On_KeyPressEvent);
 
    }
 
    private bool On_KeyPressEvent(mshtml.IHTMLEventObj e)
    {
        if (e.ctrlKey &&
            (e.keyCode == 86 || e.keyCode == 118))
        {
            MessageBox.Show("Pasted");
        }
        return true;
    }
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

'Try this coding to be added
'This is due to some control conflict between the internet explorer and Windows OS
 
Private Sub webBrowser1_DocumentCompleted1(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles webBrowser1.DocumentCompleted
    If webBrowser1.Version.Major >= 9 Then
        webBrowser1.Document.Write(webBrowser1.DocumentText)
        doc.designMode = "On"
    End If
End Sub
 

'for C#.NET


private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
if (webBrowser1.Version.Major >= 9)
{
webBrowser1.Document.Write(webBrowser1.DocumentText);
doc.designMode = "On";
}
}
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 490
1 Sergey Alexandrovich Kryukov 405
2 Maciej Los 285
3 ProgramFOX 265
4 Peter Leow 210
0 OriginalGriff 490
1 Sergey Alexandrovich Kryukov 395
2 Maciej Los 285
3 ProgramFOX 265
4 CHill60 200


Advertise | Privacy | Mobile
Web03 | 2.8.150331.1 | Last Updated 30 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100