locked
how to add ribbon to add in RRS feed

  • Question

  • Hi all,

    I'm very new to vb.net and visual studio as well. I'm using visual studio 2012 premium edition and I'm trying to develop an add in for Visio 2013. I've customized a ribbon with a button on it. I've also created a user control. I want the user to click the button on the ribbon and have the user control pop up. The problem is, I can't even figure out how to add the ribbon code into the visio add in code. I've done hours and hours of research, went and bought a book, and I feel like this task is supposed to be so easy, no one clearly specifies how it's supposed to be done. Can anyone point me in the right direction?

    Regards

    Wednesday, August 28, 2013 3:08 PM

Answers

  • Below is a new suggestion:

    Hi,
    Below is my steps for your reference:

    a) Create a visio add-in project
    b) Add a ribbon item(Visual Designer) to the project

    c) Drag a button to the ribbon:

    d) Add a user control named UserControl1 and drag a label control on it

    e) Add a new item (Windows Form) named Form1 and add below code in its construct method

    Sub New()
    
            ' This call is required by the designer.
            InitializeComponent()
    
            ' Add any initialization after the InitializeComponent() call.
    	‘replace your usercontrl here
            Me.Controls.Add(New UserControl1())
    
        End Sub
    f) Add click event by double clicking button1(Ribbon design):
    Private Sub Button1_Click(sender As Object, e As RibbonControlEventArgs) Handles Button1.Click
    Dim form1 As New Form1
            form1.Show()
    End Sub



    Thursday, August 29, 2013 11:40 AM

All replies

  • Below is a new suggestion:

    Hi,
    Below is my steps for your reference:

    a) Create a visio add-in project
    b) Add a ribbon item(Visual Designer) to the project

    c) Drag a button to the ribbon:

    d) Add a user control named UserControl1 and drag a label control on it

    e) Add a new item (Windows Form) named Form1 and add below code in its construct method

    Sub New()
    
            ' This call is required by the designer.
            InitializeComponent()
    
            ' Add any initialization after the InitializeComponent() call.
    	‘replace your usercontrl here
            Me.Controls.Add(New UserControl1())
    
        End Sub
    f) Add click event by double clicking button1(Ribbon design):
    Private Sub Button1_Click(sender As Object, e As RibbonControlEventArgs) Handles Button1.Click
    Dim form1 As New Form1
            form1.Show()
    End Sub



    Thursday, August 29, 2013 11:40 AM
  • Run the project:

    Thursday, August 29, 2013 11:43 AM