Menu "-" gives exception

  • Thread starter Thread starter Zanna
  • Start date Start date
Z

Zanna

Hi all!

Why sometimes if I put a MenuItem with Text = "-" it gives the
NotupportedException in the InitializeComponents when the

Me.MenuItem3.Text = "-"

is executed?

Some workaound for this?

Thanks!
 
Cut the statements from the InitialiseComponent and do them in the
constructor or OnLoad of your form.

Cheers
Daniel
 
Daniel Moth said:
Cut the statements from the InitialiseComponent and do them in the
constructor or OnLoad of your form.

It does not still work :(
 
Can you share the code you are trying? If I remember correctly, you must
assign the "-" before adding the menuitem to a menu.

Cheers
Daniel
 
Can you share the code you are trying? If I remember correctly, you must
assign the "-" before adding the menuitem to a menu.

Ah!
You didn't say that the Text = "-" must be assigned *before* the menuitem is
added to the menu :)

In this way it works: I moved the MenuItems.Add() in the
InitializeComponents() after the Text assignment.

Bye,
Thanks
 
You are right, I didn't say it in my first reply, sorry :-)
Glad it worked in the end.

Cheers
Daniel
 

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

Back
Top