I am pretty a beginner in using visual studio so I may missed a lot of things. I want to create a custom group in MS Project with a button which I want when I click on it, it would open up a WinForm with some buttons on it. So I created a VSTO project for MS project then added a Ribbon(Visual designer) and a form.
My custom group in Task tab created with a button in it. I double clicked on this button to jump right into it's click handler code, then tried to write a simple code to show my form but it seems it lacks something because intellisense doesn't show up .Show() method and it can not be built. The error I got when I try to build is this:
error BC30469: Reference to a non-shared member requires an object reference.
My form label is Form1 and the simplest code which I wrote in my button click event handler is as follow:
Imports Microsoft.Office.Tools.Ribbon
Imports System.Windows.Forms '(I added this line after the hints)
Public Class Ribbon1
Private Sub Ribbon1_Load(ByVal sender As System.Object, ByVal e
As RibbonUIEventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(sender As Object, e As
RibbonControlEventArgs) Handles Button1.Click
Form1.Show() '(The Line which error occurs)
End Sub
End Class