![]() |
How to clone CommandBarFrame controls runtime? |
Post Reply
|
| Author | |
Bako
Newbie
Joined: 05 April 2007 Status: Offline Points: 25 |
Post Options
Thanks(0)
Quote Reply
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? |
|
![]() |
|
Bako
Newbie
Joined: 05 April 2007 Status: Offline Points: 25 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
Bako
Newbie
Joined: 05 April 2007 Status: Offline Points: 25 |
Post Options
Thanks(0)
Quote Reply
Posted: 21 September 2007 at 3:56am |
|
Ooops!
Form2.ActiveMenuBar.Controls.AddControl Form1.ActiveMenuBar.Controls(i).Clone(True) naturally. |
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |