Hi there,
Currently I am working on docking a toolbar from an MDI parent into the MDI child and vise versa. For some reason, I am unable to remove the toolbar from a toolbar manager.
Attached is my sample of the application. There is a toolbar manager in Form1 and Form2 where each of them should be able to be removed from their respective toolbar manager. However by tearing the toolbar off from its manager and try to dock it into the other manager, I get a NullReferenceException from the code.
In my attached sample, I put two buttons where by clicking the Add button it will add a toolbar into the manager and the Remove button will remove the toolbar from the manager. I use the same method to remove the toolbar between tearing the toolbar and clicking on the buttons, but for some reason, they return a different result as I mention above.
What I am trying to achieve here is to be able to dock/undock the toolbar and switch them between managers. There is also another question on this matter. How do I detect if I am dragging the toolbar in the Form1 or Form2 area? At the moment, whenever I undock a toolbar, it will go straight to whether the MDI parent / child without checking on its active hovered area.
It would be great if some sample code is provided.
Many thanks for your help
I am still unable to find a workaround for this issue. Could you please suggest some others?
Many thanks
Hello j_rahnawan,
Thank you very much for provided sample. I`m happy to see that you are using my suggestion into your application. I saw that you are using older version of my suggestion, that`s why you get this issue . Please work with the Tollbar`s key instead of index.
Please take a look at the atatched sample and video file for more details and let me know if you have any questions.
Regards
Hi Georgi,
This solves my problem now. Many thanks for your help. Appreciate it.
Regards,
JR