Simple problem !! - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Simple problem !!

kishore_peddikishore_peddi Posts: 176Member


Hi,

Good day. I have a Menu with Menu Items. I want to create short-cuts dynamically for Menu Items. I have "CtrlF" in string format in a table. Then how to assign it to the Menu Item (with this Short-cut Key (CtrlF)).

Can you please suggest me the way with sample code ?

Advance ThanX for your time & patience.

Cheers,
Kishore

Comments

  • rai_netrai_net Posts: 51Member
    :
    :
    : Hi,
    :
    : Good day. I have a Menu with Menu Items. I want to create short-cuts dynamically for Menu Items. I have "CtrlF" in string format in a table. Then how to assign it to the Menu Item (with this Short-cut Key (CtrlF)).
    :
    : Can you please suggest me the way with sample code ?
    :
    : Advance ThanX for your time & patience.
    :
    : Cheers,
    : Kishore
    :
    :

    greetings and salutations,

    I am not sure if you need help converting the string to a shortcut or assigning the shortcut to the menuitem, but I can help you with the latter.

    [CODE]
    if(stringTableEntry == "CtrlF")
    {
    MenuItem.Shortcut = Shortcut.CtrlF;
    }
    [/CODE]

    I hope this helps you.

    rai_net
  • kishore_peddikishore_peddi Posts: 176Member

    Hi Rai,

    Good day. According to your solution, i have to checkup each and every ShortCut key in my code with "if" structure Or with "Switch" statement.This is a big task, because there are about 100 Sortcuts available (Predefined). This is the only solution ?

    My task is, i am having a DB table with column "HotKey" of "String" type in MS-SQL Server. And "HotKey" column values are like "CtrlF" etc...I am getting values dynamically from database & assinging it to MenuItems as

    MenuItem1.Shortcut = "".

    It is giving error stating that the string type can't be converted to Shortcut type.

    Glad if you could help.

    Cheers,
    Kishore


    greetings and salutations,

    I am not sure if you need help converting the string to a shortcut or assigning the shortcut to the menuitem, but I can help you with the latter.

    [CODE]
    if(stringTableEntry == "CtrlF")
    {
    MenuItem.Shortcut = Shortcut.CtrlF;
    }
    [/CODE]

    rai_net


Sign In or Register to comment.