-
VB.net popup menu...
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.
-
Re: VB.net popup menu...
You can create a form, any size you want. You can move it, resize it, and then show it.
-
Re: VB.net popup menu...
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.
-
Re: VB.net popup menu...
Why not just use the ContextMenu object, on the button's Left Click - instead of Right Click ¿
-
Re: VB.net popup menu...
Yup, ContextMenuStrip is probably the most straight forward.
Code:
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