开发者

Add A Button To A Ribbon Group DevExpress

How can I add a button to a my ribbon group programmically? Here is my code so far that successfully Adds a new ribbonPage, then Adds a RibbonGroup to the page. But I need to add buttons to the ribbonGroup and its not working for me

Imports DevExpress.XtraBars.Ribbon

Public Class Form1


    Private Sub Form1_Load(ByVal sender As Ob开发者_如何学运维ject, ByVal e As System.EventArgs) Handles Me.Load
        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



        aPage.Groups.Add(aGroup1)

        menu.Pages.Add(aPage)

        Me.Controls.Add(menu)

    End Sub


You will need to make a new button for the ribbon control as such:

Dim newButton As New DevExpress.XtraBars.BarButtonItem

Then add this to your Ribbon Page Group

aGroup1.Container.Add(newButton)
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜