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 George Jonsson 215
1 Kornfeld Eliyahu Peter 169
2 OriginalGriff 120
3 PIEBALDconsult 110
4 BillWoodruff 85
0 OriginalGriff 6,165
1 DamithSL 4,658
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,649
4 Sergey Alexandrovich Kryukov 3,294


Advertise | Privacy | Mobile
Web04 | 2.8.141220.1 | Last Updated 30 Jan 2013
Copyright © CodeProject, 1999-2014
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