Context Menu Help again...

  • Thread starter Thread starter Sender
  • Start date Start date
S

Sender

I wrote about this yesterday...and many people advised the solution. But it
didn't work. Let me put it again:

I have a form with just command button. Then I inserted a context menu
(contextmenu1). Now when I want to run the form I want to display this
context menu when someone LEFT click (not right click) this command button.
Many people told me to use contextmenu1.show method.

In the click event of the button1 I entered the following code:

contextmenu1.show()

But this doesn't work. As soon as I press enter the line becomes blue (that
means some error). Please help .

Thanks.
 
Sender said:
I wrote about this yesterday...and many people advised the solution.
But it didn't work. Let me put it again:

I have a form with just command button. Then I inserted a context
menu (contextmenu1). Now when I want to run the form I want to
display this context menu when someone LEFT click (not right click)
this command button. Many people told me to use contextmenu1.show
method.

In the click event of the button1 I entered the following code:

contextmenu1.show()

But this doesn't work. As soon as I press enter the line becomes blue
(that means some error). Please help .

Which error?
 
the original advice was pretty close. you need to spec out two arguments
with ContextMenu1.Show, the control (your button by name will work) an the
point at which you want the context menu to appaear. under my click event i
just tried (and it worked) this

Dim asd As New Point
asd.X = 2

asd.Y = 3

ContextMenu1.Show(Button1, asd)



gabe
 
Thanks ..


gabe said:
the original advice was pretty close. you need to spec out two arguments
with ContextMenu1.Show, the control (your button by name will work) an the
point at which you want the context menu to appaear. under my click event i
just tried (and it worked) this

Dim asd As New Point
asd.X = 2

asd.Y = 3

ContextMenu1.Show(Button1, asd)



gabe
 
Herfried K. Wagner said:
MSDN: 'ContextMenu.Show(ByVal control As Control, ByVal pos As
Point)'.

*argh* I've never thought that somebody would ask for _this_ reason.
 
Hello,

Sender said:
WHAT DO YOU MEAN ?????????????????????????????????
?????????????????????

*******

There is no 'Show' method for the 'ContextMenu' class that excepts no
parameters.
 
Sender said:
WHAT DO YOU MEAN
??????????????????????????????????????????????????????

*******

Shouldn't be an offending statement to you. Was only an explanation why I
didn't see the fault.
 
....this is a bit cleaner

Dim MiddleOfSender As New Point(Button1.Width / 2, Button1.Height / 2)
ContextMenu1.Show(Button1, MiddleOfSender)
 
Hello,

gabe said:
...this is a bit cleaner

Dim MiddleOfSender As New Point(Button1.Width / 2, Button1.Height / 2)
ContextMenu1.Show(Button1, MiddleOfSender)

\\\
Dim MiddleOfSender As New Point(Button1.Width * 0.5, Button1.Height * 0.5)
///

;-)
 
Back
Top