Link to home
Start Free TrialLog in
Avatar of Murray Brown
Murray BrownFlag for United Kingdom of Great Britain and Northern Ireland

asked on

VB.net Can't use a variable anywhere else in the project

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
SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Murray Brown

ASKER

Thanks very much