Home All Groups Group Topic Archive Search About
Author
7 Dec 2004 11:33 AM
ian.mcewan@atonement.net
Hi,

I have three menu user controls (this is for touchscreen
application so they can't be .Net/XP menus).

These menus all represent a common pool of commands, but
for example menu1 has command1, command2, command3,
whereas menu2 has only command2, and so on.

What is the simplest way (preferably without inordinate
redesign and abstraction) to implement ALL the commands
in one class and then hook up the menu user controls to
that class?

Thanks
Ian.
Author
7 Dec 2004 12:49 PM
Nigel Armstrong
Hi Ian

You could use the MenuItem constructor that has the EventHandler delegate
argument. Code from my head, so untested!

HTH

Nigel Armstrong

VB:

Public Class Commands
   Public Sub Command1(ByVal sender As Object, ByVal e As EventArgs)

   End Sub
'etc

End Class

In the form

Dim c As New Commands
Dim menu1 As New MenuItem("Text", AddressOf c.Command1)


Show quoteHide quote
"ian.mce***@atonement.net" wrote:

> Hi,
>
> I have three menu user controls (this is for touchscreen
> application so they can't be .Net/XP menus).
>
> These menus all represent a common pool of commands, but
> for example menu1 has command1, command2, command3,
> whereas menu2 has only command2, and so on.
>
> What is the simplest way (preferably without inordinate
> redesign and abstraction) to implement ALL the commands
> in one class and then hook up the menu user controls to
> that class?
>
> Thanks
> Ian.
>

Bookmark and Share