Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - How to clone CommandBarFrame controls runtime?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to clone CommandBarFrame controls runtime?

 Post Reply Post Reply
Author
Message
Bako View Drop Down
Newbie
Newbie


Joined: 05 April 2007
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bako Quote  Post ReplyReply Direct Link To This Post Topic: How to clone CommandBarFrame controls runtime?
    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?
Back to Top
Bako View Drop Down
Newbie
Newbie


Joined: 05 April 2007
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bako Quote  Post ReplyReply Direct Link To This Post 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


Back to Top
Bako View Drop Down
Newbie
Newbie


Joined: 05 April 2007
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bako Quote  Post ReplyReply Direct Link To This Post Posted: 21 September 2007 at 3:56am
Ooops!

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

naturally.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.031 seconds.