Avatar of Murray Brown
Murray Brown
Flag for United Kingdom of Great Britain and Northern Ireland asked on

VB.net Running a procedure behind a Custom Task Pane user control

Hi

I have a Custom Task Pane user control shown in Image 1 below. I want to run a procedure shown in the second image. What code would I used in the AddIn startup to run this?

1
2
Visual Basic.NET

Avatar of undefined
Last Comment
Murray Brown

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Nasir Razzaq

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Murray Brown

ASKER
Hi. That doesn't work
Nasir Razzaq

Any errors? Can you show more code where you are calling it?
Murray Brown

ASKER
Hi. Below is the code that has the variable TpSqlEditCustomTaskPane at the top that I am trying to call from any other part of the project but can't seem to.

Thanks



Public Class ThisAddIn


    Private _tpSqlEdit As TpSQLEdit
    Public TpSqlEditCustomTaskPane As Microsoft.Office.Tools.CustomTaskPane
    Private oUserControl1 As UserControl1
    Public oRightTaskPane As Microsoft.Office.Tools.CustomTaskPane

    Private Sub ThisAddIn_Startup() Handles Me.Startup
        'Fire the Custom TaskPane
        AddTpSqlEdit()
        AddSideTaskPane()
    End Sub

    Private Sub ThisAddIn_Shutdown() Handles Me.Shutdown

    End Sub

    'Create the Custom TaskPane and Dock Bottom
    'You must Add your Control here
    Private Sub AddTpSqlEdit()
        _tpSqlEdit = New TpSqlEdit()
        TpSqlEditCustomTaskPane = CustomTaskPanes.Add(_tpSqlEdit, "SELECT Elements")
        TpSqlEditCustomTaskPane.DockPosition = Office.MsoCTPDockPosition.msoCTPDockPositionBottom
        'Show TaskPane
        TpSqlEditCustomTaskPane.Visible = True
    End Sub

    Private Sub AddSideTaskPane()
        oUserControl1 = New UserControl1
        oRightTaskPane = CustomTaskPanes.Add(oUserControl1, "FROM Elements")
        oRightTaskPane.DockPosition = Office.MsoCTPDockPosition.msoCTPDockPositionRight
        'Show TaskPane
        oRightTaskPane.Visible = True
    End Sub




End Class
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
Murray Brown

ASKER
Hi

Thank you for the help on this question