AutoClose = False behaves strange

O

Oleg Medyanik

Hi.
Does AutoClose property works for ContextMenuStrip ?

Steps to reproduce:
1. Create new Windows Application Project
2. Add ContextMenuStrip.
2.1 Add some items (ToolStripMenuItems)
2.2. Set AutoClose = False
3. Set Form1.ContextMenuStrip = contextMenuStrip1

Run the project and rightclick the form. Context Menu does not appear for
me.
If you set AutoClose = True (default value) - everything works fine.

Thank You.
 
Joined
Oct 23, 2009
Messages
1
Reaction score
0
Efectivamente, el funcionamiento es un poco extraño pero si se establece la propiedad en tiempo de ejecución en lugar de en diseño si funciona mas o menos bien

En diseño:
1. Create new Windows Application Project / Crea un proyecto de aplicación para windows.
2. Add ContextMenuStrip. / Añade un ContextMenuStrip
3. Add some items (ToolStripMenuItems) / Añadele algunos elementos al menu
4. Set Form1.ContextMenuStrip = contextMenuStrip1 / Asigna el menú al menu contextual del formulario
5. Añade el código siguiente
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

Me.ContextMenuStrip1.AutoClose = False

End Sub

6. Run

Así si funciona correctamente aunque no se porque al establecer dicha propiedad en diseño el comportamiento es totalmente distinto.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top