Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Elegant Ribbon Tech Support » Error Collapse All
Subject Author Date
Sven Rutten Jul 26, 2007 - 3:44 AM

Hello

If I am creating a new emptry project (with Form1), then I am adding a new Form (Form2) to it.
On Form2 I put a Ribbon

On Form1 a single Button, with the code:

Dim x As New Form2
x.ShowDialog()

Ok if I build and run it, the form2 with the Ribbon is loading correctly when I am pressing Button1 on Form1.
But if I now close Form2, and then I am pressing again on Button1, I get the error: "Object with the same Id is already registered."

Seems like the IDs of the first initialization of Form2 are stored somewhere and not deleted when the form is closing, so they still exist when I want to shot the Form2 a second time...

Thanks

Sven

Technical Support Jul 26, 2007 - 4:33 AM

Thank you for reporting the problem. It is caused by that we are using control Ids for saving/restoring the UI state. We will fix it in the next release (coming soon). You can workaround the problem in the following way. Open the form’s designer file and remove ID properties from ALL the Form2 components. This should fix the problem. Please note that if you open the designer again, make some changes and save the file, new Ids for the controls will be generated again.

Sven Rutten Jul 26, 2007 - 4:44 AM

Thanks for the quick reply.
I tried to fix it like you adviced, but that didnt solve it. On Form1 I have no Ribbon.
If I delete all IDs, I get new ones, that is correct. But I think the problem is, that creating while a new (second) instance of Form2, it is trying to use the same IDs as on the first instance (but also if I close the first instance)
So I think that the IDs of the first instance which is closed are still stored somewhere...

How soon is your soon? Will it be before end of July?

Thanks

Sven

Sven Rutten Jul 26, 2007 - 4:57 AM

Sorry I thought that you adviced me to create new IDs, but now that I read your comment again, I noticed that I should only delete them.

Technical Support Jul 26, 2007 - 4:56 AM

Another approach that should definitely help you is as follows. Create Form2 only once and do not destroy and create when you need to hide or show it but rather just hide and show it. The problem will be gone.

Actually the new version is ready and now being tested. It will be released next week.

Sven Rutten Jul 26, 2007 - 4:57 AM

That’s great, thanks, I’m looking forward to it