Print Page | Close Window

How to clone CommandBarFrame controls runtime?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=8039
Printed Date: 06 November 2025 at 2:53pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to clone CommandBarFrame controls runtime?
Posted By: Bako
Subject: How to clone CommandBarFrame controls runtime?
Date Posted: 17 September 2007 at 8:02am
Hi,

Form1 has got CommandBarFrame with menu items created in design time.
Form2 has got CommandBarFrame without any menu items (it's empty).

I need programatically clone menu items from Form1 to Form2.

Any idea?



Replies:
Posted By: Bako
Date Posted: 21 September 2007 at 3:55am
I got it!

Every MenuBarControl has method named Clone().

I does something like this:

for i = 1 to Form1.ActiveMenuBar.Controls.Count
   Form2.ActiveMenuBar.Controls.Add   Form1.ActiveMenuBar.Controls(i).Clone(True)
next i




Posted By: Bako
Date Posted: 21 September 2007 at 3:56am
Ooops!

Form2.ActiveMenuBar.Controls.AddControl   Form1.ActiveMenuBar.Controls(i).Clone(True)

naturally.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net