Hi,

I'm working on a checklist program and I want to use the contextmenu with
it.
For each checkpoint there is a textbox and when the user holds his stylus on
it he will get a contextmenu with the possible answers for that checkpoint.
These contextmenu's are with different answers for each point, so they are
created in the contextmenu_popup sub.

Some have 2 menu_items and some have 11.

something like:
Dim mnuItem As New MenuItem
If mnuTxtBox Is txt1 Then
cmThs.MenuItems.Clear()
mnuItem.Text = "Shelter"
cmThs.MenuItems.Add(mnuItem)
mnuItem.Text = "Building"
cmThs.MenuItems.Add(mnuItem)
mnuItem.Text = "Bsc"
cmThs.MenuItems.Add(mnuItem)
mnuItem.Text = "Anders"
cmThs.MenuItems.Add(mnuItem)
End If

Now I need to get the selected item through some kind of click_event.

How do I make one?
The basic idea is to write one sub in which is determent which menu was
shown and which item was tapped on.

thanks in advance!
Eric

Re: ContextMenu MenuItem Event by Daniel

Daniel
Sat Jan 01 14:03:02 CST 2005

MenuItems expose a Click event. You can dynamically add an event handler to
it in VB with AddHandler. Something like:
AddHandler mnuItem.Click, AddressOf SomeMethod

Cheers
Daniel
--
http://www.danielmoth.com/Blog/


"EMW" <someone@MikroZoft.com> wrote in message
news:41d6ffe4$0$44107$5fc3050@dreader2.news.tiscali.nl...
> Hi,
>
> I'm working on a checklist program and I want to use the contextmenu with
> it.
> For each checkpoint there is a textbox and when the user holds his stylus
> on it he will get a contextmenu with the possible answers for that
> checkpoint.
> These contextmenu's are with different answers for each point, so they are
> created in the contextmenu_popup sub.
>
> Some have 2 menu_items and some have 11.
>
> something like:
> Dim mnuItem As New MenuItem
> If mnuTxtBox Is txt1 Then
> cmThs.MenuItems.Clear()
> mnuItem.Text = "Shelter"
> cmThs.MenuItems.Add(mnuItem)
> mnuItem.Text = "Building"
> cmThs.MenuItems.Add(mnuItem)
> mnuItem.Text = "Bsc"
> cmThs.MenuItems.Add(mnuItem)
> mnuItem.Text = "Anders"
> cmThs.MenuItems.Add(mnuItem)
> End If
>
> Now I need to get the selected item through some kind of click_event.
>
> How do I make one?
> The basic idea is to write one sub in which is determent which menu was
> shown and which item was tapped on.
>
> thanks in advance!
> Eric
>
>
>
>
>



Re: ContextMenu MenuItem Event by EMW

EMW
Sat Jan 01 17:13:59 CST 2005

Thanks!!

"Daniel Moth" <dmoth74@hotmail.com> schreef in bericht
news:eI96ezD8EHA.1300@TK2MSFTNGP14.phx.gbl...
> MenuItems expose a Click event. You can dynamically add an event handler
> to it in VB with AddHandler. Something like:
> AddHandler mnuItem.Click, AddressOf SomeMethod
>
> Cheers
> Daniel
> --
> http://www.danielmoth.com/Blog/
>
>
> "EMW" <someone@MikroZoft.com> wrote in message
> news:41d6ffe4$0$44107$5fc3050@dreader2.news.tiscali.nl...
>> Hi,
>>
>> I'm working on a checklist program and I want to use the contextmenu with
>> it.
>> For each checkpoint there is a textbox and when the user holds his stylus
>> on it he will get a contextmenu with the possible answers for that
>> checkpoint.
>> These contextmenu's are with different answers for each point, so they
>> are created in the contextmenu_popup sub.
>>
>> Some have 2 menu_items and some have 11.
>>
>> something like:
>> Dim mnuItem As New MenuItem
>> If mnuTxtBox Is txt1 Then
>> cmThs.MenuItems.Clear()
>> mnuItem.Text = "Shelter"
>> cmThs.MenuItems.Add(mnuItem)
>> mnuItem.Text = "Building"
>> cmThs.MenuItems.Add(mnuItem)
>> mnuItem.Text = "Bsc"
>> cmThs.MenuItems.Add(mnuItem)
>> mnuItem.Text = "Anders"
>> cmThs.MenuItems.Add(mnuItem)
>> End If
>>
>> Now I need to get the selected item through some kind of click_event.
>>
>> How do I make one?
>> The basic idea is to write one sub in which is determent which menu was
>> shown and which item was tapped on.
>>
>> thanks in advance!
>> Eric
>>
>>
>>
>>
>>
>
>