locked
Function keys (e.g. F5) in Tab on WHS Console RRS feed

  • Question

  • Hi all, I have one question and I hope that someone can help me ;-) I need to make my Tab on WHS console ready for function keys pressing (e.g. F5 to refresh). But the problem is that when I use classic handling for Panel (as the highest object accessible from my Tab scope)

    ...

    this.m_tabControl.KeyDown += new System.Windows.Forms.KeyEventHandler(this.tabControl_KeyDown);

    ...

    private void tabControl_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)

    {

    if (e.KeyCode == Keys.F5)

    {

    // do something...

    }

    }

     

    it doesn't work. When I press "normal" key (e.g. q,5,b) it works, but when I press F5, the method is not called. It looks that WHS console doesn't propagate such calling to Tab and handle it by itself. I have found some info about IMessageFilter, but I think that I cannot use it, because I cannot access the application scope. Or maybe that I have missed something. Is there some solution of such problem? Any idea will be appeciated. Many thanks!

    Monday, October 8, 2007 7:27 PM

All replies

  • Despite the parent form having it’s KeyPreview property set to True (which is required for such an interception)... from the looks of it something else is catching the key stroke... one quick (and undocumented) way to handle this (if you just want F5/refresh triggering) is to implement the Microsoft.HomeServer.Extensibility.ITabExtender interface and implement your refresh code in the Refresh() method.

     

    After doing so, whenever F5 is pressed on the form, your Refresh() method (provided your tab is selected) is called.

     

    Remember though... this is undocumented.

    Wednesday, October 10, 2007 1:03 AM
    Moderator