C#

Moderators: None (Apply to moderate this forum)
Number of threads: 2720
Number of posts: 5746

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Simple problem !! Posted by kishore_peddi on 3 Oct 2003 at 5:03 AM


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

Report
Re: Simple problem !! Posted by rai_net on 3 Oct 2003 at 9:56 PM
:
:
: 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.

if(stringTableEntry == "CtrlF")
{
	MenuItem.Shortcut = Shortcut.CtrlF;
}


I hope this helps you.

rai_net
Report
Can you please refer once again the problem ? Posted by kishore_peddi on 5 Oct 2003 at 5:49 AM

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 = "<DB Column Value>".

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.

 if(stringTableEntry == "CtrlF")
 {
 	MenuItem.Shortcut = Shortcut.CtrlF;
 }
 


rai_net





 

Recent Jobs