Click to See Complete Forum and Search --> : VB.net popup menu...


aaronking
November 30th, 2009, 08:37 PM
Hello,

Is there a way of creating a popup menu in vb.net?

I want to be able to click a button and it pop up the menu next to the button.

But, I want the size of the text in the menu a bit bigger.

anyone know how to do it?

(I have been trying for a while now and can't work it out)

Thanks.

dglienna
December 1st, 2009, 08:53 PM
You can create a form, any size you want. You can move it, resize it, and then show it.

aaronking
December 2nd, 2009, 06:42 PM
Hello,

That is for a form.. I am talking about a menu.

I want to be able to click on a button and display the menu where the button is.

I don't want to resize a form or move a form.

HanneSThEGreaT
December 4th, 2009, 03:31 AM
Why not just use the ContextMenu object, on the button's Left Click - instead of Right Click ¿

TT(n)
December 4th, 2009, 10:26 AM
Yup, ContextMenuStrip is probably the most straight forward.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim nf As New Font(Drawing.FontFamily.GenericSansSerif, 10, FontStyle.Regular)
ContextMenuStrip1.Font = nf
ContextMenuStrip1.Show(Button1, 5, 5)
End Sub