Click here to Skip to main content
15,898,036 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
I am making a project in vb.net .I want that when button is clicked a small menu appears in front of button and contains some buttons

What I have tried:

I have tried menu toolstrip but I didnt worked
Posted
Updated 19-Jun-20 8:09am
v2
Comments
Richard MacCutchan 19-Jun-20 8:11am    
We have no idea what you tried or what your code is doing. Please edit your question and add some proper details.

1 solution

Create a UserControl, and put your buttons on it.

When the first button is clicked, create an instance of your new control and set it's location to the top left of the button, show it, and call BringToFront:
VB
Dim mc As MyControl = New MyControl()
mc.Location = MyButton.Location
Controls.Add(mc)
mc.Show()
mc.BringToFront()
When you want to get rid of it again, remove it from the Controls collection, then Close and Dispose the new Control instance.
 
Share this answer
 
Comments
Maciej Los 19-Jun-20 8:44am    
;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900