开发者

Creating A Menu programmatically DevExpress

How to create a menu dynamically?

In detail I want to:

  • Create a new ribbon page (tab, I think it's called ribbon page)
  • Next create a title for the page
  • Next add 2 ribbon groups and add titles to them
  • Next add 3 bar button items to the first ribbon group

开发者_如何学PythonHow to accomplish this?


 Dim menu As New RibbonControl


    Dim aPage As New RibbonPage("Nicks Page")

    'groups
    Dim aGroup1 As New RibbonPageGroup("1st Group")


    'ADD BUTTONS TO RIBBON GROUP HERE
    Dim i As New DevExpress.XtraBars.BarButtonItem()

    i.Caption = "Nicks Button"

    aGroup1.ItemLinks.Add(i)




    Dim i2 As New DevExpress.XtraBars.BarButtonItem()
    i2.Caption = "Nicks Other Button"

    aGroup1.ItemLinks.Add(i2)




    aPage.Groups.Add(aGroup1)

    menu.Pages.Add(aPage)

    Me.Controls.Add(menu)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜