Home All Groups Group Topic Archive Search About

Menu / Tool Strips..

Author
13 Apr 2006 11:03 PM
Vijay
Why wasn't the toolbar, menu bar items developed as a single BarItem and
then allowed us to build as Toolbar or a MenuBar. This way I could just have
one click event. I do have in my code in a method for say a toolbarItem
click.. But when I add the same to a menu, I have to attach a item click
event and call the method. If it was developed as a single BarItem, life
would have been easier. Any reason why it is not done so?

Vijay

Author
14 Apr 2006 1:39 PM
tlkerns
I believe you can do this with one event handler:

Private Sub MenuOrTool_Click(ByVal sender As Object, ByVal e As EventArgs) _
    Handles MenuItem.Click, ToolStripItem.Click
....
End Sub

Tony

Show quote
"Vijay" wrote:

> Why wasn't the toolbar, menu bar items developed as a single BarItem and
> then allowed us to build as Toolbar or a MenuBar. This way I could just have
> one click event. I do have in my code in a method for say a toolbarItem
> click.. But when I add the same to a menu, I have to attach a item click
> event and call the method. If it was developed as a single BarItem, life
> would have been easier. Any reason why it is not done so?
>
> Vijay
>
>
>
Author
14 Apr 2006 2:15 PM
Vijay
That is like calling a Function from 2 events.. or even in C# you can attach
same event function to 2 events.. But what I am talking is different.. It is
just not event. It is just one object that can be referenced in menu and
toolbars, Could that save size? yes it can. Also I don't have to worry about
making sure I have the bitmap or icon attached is same to the menu and
toolbar item.. lot of benefits.. Most third party companies that offer the
Toolbar/Menu components provide this.. I am surprised Microsoft did not do
this...., when their line is "Do more with less"

VJ

Show quote
"tlkerns" <tlke***@discussions.microsoft.com> wrote in message
news:CDD4521A-DEE2-4812-AA51-0B151B094C04@microsoft.com...
>I believe you can do this with one event handler:
>
> Private Sub MenuOrTool_Click(ByVal sender As Object, ByVal e As EventArgs)
> _
>    Handles MenuItem.Click, ToolStripItem.Click
> ...
> End Sub
>
> Tony
>
> "Vijay" wrote:
>
>> Why wasn't the toolbar, menu bar items developed as a single BarItem and
>> then allowed us to build as Toolbar or a MenuBar. This way I could just
>> have
>> one click event. I do have in my code in a method for say a toolbarItem
>> click.. But when I add the same to a menu, I have to attach a item click
>> event and call the method. If it was developed as a single BarItem, life
>> would have been easier. Any reason why it is not done so?
>>
>> Vijay
>>
>>
>>

AddThis Social Bookmark Button