Click here to Skip to main content
16,004,806 members
Home / Discussions / C#
   

C#

 
GeneralRe: PeopleSoft API and C# Pin
eggie517-Jun-04 23:02
eggie517-Jun-04 23:02 
GeneralWM_LBUTTONDOWN Message Pin
Guinness4Strength17-Jun-04 10:04
Guinness4Strength17-Jun-04 10:04 
GeneralRe: WM_LBUTTONDOWN Message Pin
Heath Stewart17-Jun-04 17:11
protectorHeath Stewart17-Jun-04 17:11 
GeneralRe: WM_LBUTTONDOWN Message Pin
Guinness4Strength18-Jun-04 2:58
Guinness4Strength18-Jun-04 2:58 
GeneralRe: WM_LBUTTONDOWN Message Pin
Heath Stewart18-Jun-04 3:44
protectorHeath Stewart18-Jun-04 3:44 
GeneralContext Menu Help Pin
StephenMcAllister17-Jun-04 9:48
StephenMcAllister17-Jun-04 9:48 
GeneralRe: Context Menu Help Pin
LongRange.Shooter17-Jun-04 10:47
LongRange.Shooter17-Jun-04 10:47 
GeneralRe: Context Menu Help Pin
Heath Stewart17-Jun-04 17:17
protectorHeath Stewart17-Jun-04 17:17 
Basically, what theRealCondor is trying to say, is that all the MenuItems you create should reference the same event handler for their Click events. You then get the MenuItem that was clicked using the first parameter of the event handler:
for (int i=0; i < 5; i++)
{
  MenuItem menu = new MenuItem("Menu " + i.ToString());
  menu.Click += new EventHandler(MenuItem_Click);
  contextMenu1.MenuItems.Add(menu);
}
// ...
private void MenuItem_Click(object sender, EventArgs e)
{
  MenuItem menu = sender as MenuItem;
  if (menu != null) MessageBox.Show(menu.Text + " was clicked.");
}
...and I didn't even need VS.NET.

 

Microsoft MVP, Visual C#
My Articles
QuestionVB6 Modules =? in C# ??? Pin
antoine@orchus-tech17-Jun-04 9:31
antoine@orchus-tech17-Jun-04 9:31 
AnswerRe: VB6 Modules =? in C# ??? Pin
Judah Gabriel Himango17-Jun-04 9:43
sponsorJudah Gabriel Himango17-Jun-04 9:43 
GeneralRe: VB6 Modules =? in C# ??? Pin
antoine@orchus-tech17-Jun-04 10:03
antoine@orchus-tech17-Jun-04 10:03 
GeneralRe: VB6 Modules =? in C# ??? Pin
Judah Gabriel Himango17-Jun-04 10:10
sponsorJudah Gabriel Himango17-Jun-04 10:10 
AnswerRe: VB6 Modules =? in C# ??? Pin
LongRange.Shooter17-Jun-04 10:55
LongRange.Shooter17-Jun-04 10:55 
GeneralUnsafe code in user control Pin
Shree17-Jun-04 6:56
Shree17-Jun-04 6:56 
GeneralRe: Unsafe code in user control Pin
Dave Kreskowiak17-Jun-04 7:03
mveDave Kreskowiak17-Jun-04 7:03 
GeneralRe: Unsafe code in user control Pin
Shree17-Jun-04 7:09
Shree17-Jun-04 7:09 
GeneralRe: Unsafe code in user control Pin
Dave Kreskowiak17-Jun-04 8:00
mveDave Kreskowiak17-Jun-04 8:00 
Generalcustom control ide properties &quot;items&quot; question Pin
FocusedWolf17-Jun-04 6:54
FocusedWolf17-Jun-04 6:54 
GeneralRe: custom control ide properties &quot;items&quot; question Pin
LongRange.Shooter17-Jun-04 10:57
LongRange.Shooter17-Jun-04 10:57 
GeneralRe: custom control ide properties &quot;items&quot; question Pin
FocusedWolf21-Jun-04 4:35
FocusedWolf21-Jun-04 4:35 
QuestionHow to operate USB port Pin
wk_vigorous17-Jun-04 6:27
wk_vigorous17-Jun-04 6:27 
AnswerRe: How to operate USB port Pin
Aaron Eldreth17-Jun-04 6:46
Aaron Eldreth17-Jun-04 6:46 
GeneralRe: How to operate USB port Pin
eggie517-Jun-04 18:13
eggie517-Jun-04 18:13 
AnswerRe: How to operate USB port Pin
Dave Kreskowiak17-Jun-04 6:54
mveDave Kreskowiak17-Jun-04 6:54 
AnswerRe: How to operate USB port Pin
eggie517-Jun-04 18:14
eggie517-Jun-04 18:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.