开发者

SpiceIE Internet Explore extension - backspace doesn't work

I've seen this question circulate around the internet a lot, but haven't found an answer that has solved my problem. I am basically using SpicIE.Controls.Toolbar (C#) to create an explorer bar for IE. It has a few text-boxes on it among other things. The problem I have is that when I am typing in the text-box and hit backspace, the browser handles it and instead of deleting the character on the text-box, it goes back 开发者_运维问答one page on the browser. In order to fix this problem, I created my own custom text box to be able to handle backspace properly:

public class MyTextBox:TextBox
{
    protected override void OnKeyUp(KeyEventArgs e)
    {
        if (e.KeyValue == 8)
        {
            this.Text = this.Text.Substring(0, this.Text.Length - 1);
            this.SelectionStart = this.Text.Length + 1;
            e.Handled = true;
        }
    }
}

The code does work as it is supposed to but the browser still goes back one page even after e.Handled is set to be true.

Can anyone help me with this? I feel like I have been to all forums where they discuss this, and still haven't found an answer

Thanks for your help guys!


Generally when this happens it means the extension did not implement IInputObject correctly. I'm not familiar with the SpicIE framework, so I'm not sure if you need to implement it or they do.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜