context menu and buttons response time

htrada

Freshman
Joined
May 30, 2004
Location
La Plata, Argentina
Hi,
I´m currently developing an aplicaction wich does not require too much CPU time it´s, but I´m havig trouble with the interface. When the user clicks on a contextmenu sometimes you have to click 3 or 4 times till the control rises the menuitem click event. I know it sound silly but it is a really anoying thing.
Did anyone had this problem??
bye,
hernan
 

Iceplug

Contributor
Joined
Aug 20, 2001
Location
California, USA
So, it's taking you a long time between when you click the button and when the contextmenu shows up, or when you click a contextmenu option and for its event to run? What code are you using for the button click?
 

htrada

Freshman
Joined
May 30, 2004
Location
La Plata, Argentina
I have no problem when showing the context menu, the problem is when I click in one of the options. It simply doesn´t seem to get my clicks i need to click several times till the event raises.

to handle the click I have the folowing line when I build the context menu

AddHandler menuItem(i).Click, AddressOf MenuItem_Click

then I have a sub defined like this

Private Sub MenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
 

Iceplug

Contributor
Joined
Aug 20, 2001
Location
California, USA
What's i? Are you trying to make a control array? I need to see more detail than that. I need to see how you are setting the context menu arrays up and how they are applied to the button. Have you tried putting in a Debug.WriteLine in the menu click procedure or maybe a Me.Text = ????
 

htrada

Freshman
Joined
May 30, 2004
Location
La Plata, Argentina
yep I first define a menuitem array

Dim menuItem() As MenuItem

then I redim it and configure each element
then I add it to the contextmenu ("contextcanales") and finally I add the event handler

for i........
contextcanales.MenuItems.Add(menuItem(i))
AddHandler menuItem(i).Click, AddressOf MenuItem_Click
next i

The only thing I modify from the menuitem is its name, then I leave everything with its default options
thanks
Hernan
 

htrada

Freshman
Joined
May 30, 2004
Location
La Plata, Argentina
I´m showing it over a user control (wich consists of several groupbox with some labels in each of them).
and I show it using
contextcanales.Show(Me.pnlvisores, pos)

where pos is a point object and pnlvisores is the user control
 
Top Bottom