Hi! Sorry but WebBrowser haven't event KeyDown.... And Your sample doesn't work... In my sample, some keys work normal...but "Ctrl+A, Ctrl+C" - does'nt work. protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { if (keyData == (Keys.Control | Keys.N))//Normal { if (this.axWebBrowser1.ReadyState != SHDocVw.tagREADYSTATE.READYSTATE_COMPLETE) { return false; } FEX f1 = new FEX (); f1.Text = "(New window)"; f1.Show(); return true; } else if (keyData == (Keys.Control | Keys.Q))//normal { MessageBox.Show("Q"); return true; } else if (keyData == (Keys.Escape)) { this.Close(); return true; } else if(keyData == (Keys.A | Keys.Control)) { MessageBox.Show("113"); //Doesn't work return true; } else { return base.ProcessCmdKey(ref msg, keyData); } } P.S. Sorry for my mistakes!!!
COBECTb
Posts
-
How to disable "Ctrl+A, Ctrl+C" buttons on WebBrowser? -
How to disable "Ctrl+A, Ctrl+C" buttons on WebBrowser?Sorry but my WebBrowser was created in Windows Application, VS 2003, FW 1.1, here sample: private AxSHDocVw.AxWebBrowser axWebBrowser1; private void Form1_Load(object sender, System.EventArgs e) { object oURL = "www.codeproject.com"; object oEmpty = ""; axWebBrowser1.Navigate2(ref oURL, ref oEmpty, ref oEmpty, ref oEmpty, ref oEmpty); } //Event which open links in new windows\ private void axWebBrowser1_NewWindow2(object sender, AxSHDocVw.DWebBrowserEvents2_NewWindow2Event e) { if (this.axWebBrowser1.ReadyState != SHDocVw.tagREADYSTATE.READYSTATE_COMPLETE) { e.ppDisp = null; e.cancel = true; return; } FEX f1 = new FEX(); f1.Text = "(New window)"; e.ppDisp = f1.axWebBrowser1.Application; f1.Show(); } And how I can use Your sample? Sorry but I don't know....:(
-
How to disable "Ctrl+A, Ctrl+C" buttons on WebBrowser?Thank's for You help, but how can I use Your sample for axWebBrowser1? I'm only junior in programming, and very much I don't understand... :(
-
How to disable "Ctrl+A, Ctrl+C" buttons on WebBrowser?Hi all! Sorry for my poor english.... Here my problem, I created WebBrowser,and now I need to disable, "Select_all" and "Copy" fulctions in browser. I disabled ContextMenu, but keys Ctrl+A, Ctrl+C working. I tryed to using ProcessCmdKey,ProcessDialogKey,for catching this Keys but "Ctrl+A, Ctrl+C" are not catching.... If somebody knows how do it, please help me... P.S. Sorry for my mistakes.
-
How to disable right click mouse, select and copy text in WebBrowserHi, all!!! I created a simple WebBrowser, and now I need disable right mouse clicking, copy and select text in this WebBrowser. If somebody knows how do it, please help me... Thank's