Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 3rd, 2008, 12:35 AM
Authorized User
 
Join Date: Aug 2008
Posts: 38
Thanks: 1
Thanked 0 Times in 0 Posts
Default custom delegate for ToolStripMenuItem

Is it possible to create custom delegate and event for a ToolStripMenuItem?

Is it possible to assign this kind of method for a delegate using Click as event

 private void deleteToolStripMenuItem_Click(EventArgs e,exListBox lstBox_All,exListBox lstBox_Any)
{
...
}

Please show how...

Thanks in advance...


 
Old September 3rd, 2008, 01:14 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

The Click event is already defined as a property of the ToolStripMenuItem - as are its parameters.

I'm not sure what you are trying to achieve here so can't really give you any other advice.

/- Sam Judson : Wrox Technical Editor -/
 
Old September 3rd, 2008, 02:13 AM
Authorized User
 
Join Date: Aug 2008
Posts: 38
Thanks: 1
Thanked 0 Times in 0 Posts
Default

I was just thinking of creating a click event for ToolStripMenuItem having different delegate signature (event handler not the usual System.EventArgs)..uhm..final question ..
How can i implement an Array of listBox...
Suppose i have 5 listboxes i want them to be in an array..I can access a particular listbox by assigning an index..i read about IEnumerator but i'm not sure if this one will help, i'm still in the process of understanding this topic..Hope you'll be patient with me..thanks again..


 
Old September 3rd, 2008, 02:40 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

Well you can define an array of anything:

ListBox[] a = new ListBox[5];

or use generics yo create a list of listboxes:

List<ListBox> l = new List<ListBox>();

/- Sam Judson : Wrox Technical Editor -/
 
Old September 4th, 2008, 03:07 AM
Authorized User
 
Join Date: Aug 2008
Posts: 38
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Thanks for the help..it worked






Similar Threads
Thread Thread Starter Forum Replies Last Post
ToolStripMenuItem Enter & Leave Event angelboy C# 2005 6 November 21st, 2008 04:57 PM
Delegate query elwappo General .NET 6 June 5th, 2008 03:07 AM
Error when adding a ToolStripMenuItem Lucy_H85 C# 2005 2 October 30th, 2007 07:55 AM
What Is Delegate jayakumar.cj ASP.NET 1.0 and 1.1 Basics 1 July 15th, 2006 06:09 AM
Business Delegate Pattern for Accessing Remote EJB mlumsden BOOK: Expert One-on-One J2EE Design and Development 1 September 25th, 2003 03:31 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.