Is it Possible to assign a Short Cut Key dynamically for ToolStripMenuItem ? or Table Driven ?
Thanks,
Shankar
How to Assign Short Cut Key in ToolStripMenuItem Dynamically
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.


venkata kumarRank #5,034 · 314 reputationPosted Nov 25, 2012, 10:49 PM EST
u can write fallowing code in formname_keydown
private void PurchaseReturn_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.N && e.Control)
{
//code
}
}
Thanks & Regards
Kumar
Shankar MRank #874 · 2.5K reputationPosted Nov 26, 2012, 1:28 AM EST
Hi Ravi,
No Ravi, I mean Whether the Shortcuts can be assigned something like Table-Driven values,
Suppose if I have maintain a column in Table with ShortCutKey and bind it with the value
Keys.Control | Keys.C. So that I can assign the ShortCutKey to the ToolStripMenuItem and add it to the ToolStrip Items dynamically at run when Loading the MenuStrip dynamically.
Thanks,
Shankar