Click here to Skip to main content
16,011,702 members
Home / Discussions / C#
   

C#

 
GeneralRe: Multiple dynamic combobox databinding Pin
Nick Parker25-Feb-04 1:33
protectorNick Parker25-Feb-04 1:33 
GeneralRe: Multiple dynamic combobox databinding Pin
Itay Sagui25-Feb-04 7:12
Itay Sagui25-Feb-04 7:12 
GeneralPrivate Object goes NULL after entering Public Function Pin
Euphorix24-Feb-04 10:19
Euphorix24-Feb-04 10:19 
GeneralRe: Private Object goes NULL after entering Public Function Pin
Heath Stewart24-Feb-04 12:37
protectorHeath Stewart24-Feb-04 12:37 
GeneralInsure Numeric Data in TextBox Pin
ronboy24-Feb-04 9:39
ronboy24-Feb-04 9:39 
GeneralRe: Insure Numeric Data in TextBox Pin
Heath Stewart24-Feb-04 12:36
protectorHeath Stewart24-Feb-04 12:36 
GeneralRe: Insure Numeric Data in TextBox Pin
Huseyin Altindag25-Feb-04 10:20
Huseyin Altindag25-Feb-04 10:20 
QuestionHow to get Key-Press Event in "Web Browser Control" Pin
Moloy Bagchi24-Feb-04 9:24
Moloy Bagchi24-Feb-04 9:24 
have a web browser control attched to a win form. Now I have to capture the mousemove event,mouseclick event and keypress event ,, the moment someone moves his mouse or press a key on the document , I should be able to capture the event. I could able to capture the mouse move and mouse click but no key press. I have to somehow capture the keypress event. I donot know how and it is very urgent. Any help would be really appreciated. follwing is my partial code .

private void Form1_Load(object sender, System.EventArgs e)
{
object oURL = "http://www.google.com";
object oEmpty = "";
axWebBrowser1.Navigate2(ref oURL, ref oEmpty, ref oEmpty, ref oEmpty, ref oEmpty);

}

private void DocumentComplete(object sender,AxSHDocVw.DWebBrowserEvents2_DocumentCompleteEvent e)
{
mshtml.HTMLDocument doc;
doc=(mshtml.HTMLDocument)axWebBrowser1.Document;
mshtml.HTMLDocumentEvents2_Event iEvent;
iEvent=(mshtml.HTMLDocumentEvents2_Event)doc;
iEvent.onclick+=new mshtml.HTMLDocumentEvents2_onclickEventHandler(ClickEventHandler);
iEvent.onmouseover += new mshtml.HTMLDocumentEvents2_onmouseoverEventHandler(MouseOverEventHandler);
iEvent.onkeypress+= new mshtml.HTMLDocumentEvents2_onkeypressEventHandler(KeyPressEventHandler);
iEvent.onkeydown+= new mshtml.HTMLDocumentEvents2_onkeydownEventHandler(KeyDownEventHandler);
listBox1.Items.Clear();

}

private bool ClickEventHandler(mshtml.IHTMLEventObj e)
{
if( e.srcElement.tagName == "INPUT" )
{

}
listBox1.Items.Insert(0, e.type + ":" + e.clientX.ToString()+","+e.clientY.ToString());
return true;
}
private void MouseOverEventHandler(mshtml.IHTMLEventObj e)
{
listBox1.Items.Insert(0, e.type + ":" + e.x.ToString()+","+ e.y.ToString());
}
private bool KeyPressEventHandler(mshtml.IHTMLEventObj e)
{
listBox1.Items.Insert(0,e.type + ":" + e.srcElement.recordNumber.ToString());
return true;
}
private void KeyDownEventHandler(mshtml.IHTMLEventObj e)
{
listBox1.Items.Insert(0,e.type+":"+e.srcElement.innerText.ToString() );


}

How can I capture the Key Press Event.
Thanks
Moloy

GeneralProperty Procedure Pin
ajkumar24-Feb-04 8:53
ajkumar24-Feb-04 8:53 
GeneralRe: Property Procedure Pin
Werdna24-Feb-04 9:28
Werdna24-Feb-04 9:28 
GeneralRe: Property Procedure Pin
ian mariano24-Feb-04 11:29
ian mariano24-Feb-04 11:29 
GeneralForm using too much memory Pin
Shaun Becker24-Feb-04 7:52
Shaun Becker24-Feb-04 7:52 
GeneralRe: Form using too much memory Pin
je_gonzalez24-Feb-04 9:41
je_gonzalez24-Feb-04 9:41 
GeneralRe: Form using too much memory Pin
Shaun Becker24-Feb-04 10:45
Shaun Becker24-Feb-04 10:45 
GeneralRe: Form using too much memory Pin
Heath Stewart24-Feb-04 12:30
protectorHeath Stewart24-Feb-04 12:30 
GeneralRe: Form using too much memory Pin
Charlie Williams24-Feb-04 12:36
Charlie Williams24-Feb-04 12:36 
GeneralRe: Form using too much memory Pin
Charlie Williams24-Feb-04 12:35
Charlie Williams24-Feb-04 12:35 
GeneralRe: Form using too much memory Pin
CWIZO24-Feb-04 23:43
CWIZO24-Feb-04 23:43 
GeneralRe: Form using too much memory Pin
Charlie Williams25-Feb-04 10:28
Charlie Williams25-Feb-04 10:28 
GeneralRe: DateTime.Now in a label Pin
Nick Parker24-Feb-04 7:40
protectorNick Parker24-Feb-04 7:40 
GeneralRe: DateTime.Now in a label Pin
Dave Kreskowiak24-Feb-04 7:42
mveDave Kreskowiak24-Feb-04 7:42 
GeneralHelp, How to add a footer to a windows form Datagrid Pin
mdolby24-Feb-04 6:32
mdolby24-Feb-04 6:32 
GeneralRe: Help, How to add a footer to a windows form Datagrid Pin
Heath Stewart24-Feb-04 12:29
protectorHeath Stewart24-Feb-04 12:29 
GeneralHelp using C# COM Interop in VBA / Excel Pin
BeeBar24-Feb-04 4:49
sussBeeBar24-Feb-04 4:49 
GeneralRe: Help using C# COM Interop in VBA / Excel Pin
Nick Parker24-Feb-04 6:44
protectorNick Parker24-Feb-04 6:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.