Here is my vb.net sample for a PLSS finder in response to my question above. My "tool" starts with a button on the toolbar, which then opens up a dockable window with several comboboxes.
_______________________________________________________________
DockableWindow.vb:
Imports ESRI.ArcGIS.esriSystem
Imports ESRI.ArcGIS.Framework
Imports ESRI.ArcGIS.ArcMapUI
Imports ESRI.ArcGIS.Desktop
Imports ESRI.ArcGIS.Geodatabase
Imports ESRI.ArcGIS.Geometry
Imports ESRI.ArcGIS.Carto
Public Class SLO_DockableWindow1
Public sMer As String
Public sSection As String
Public sTwp As String
Public sRng As String
Public sTwpD As String
Public sRngD As String
Public sUnit As String
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim pMap As IMap
Dim pMxDoc As IMxDocument
Dim pActiveView As IActiveView
pMxDoc = My.ArcMap.Document
pMap = pMxDoc.FocusMap
pActiveView = pMap
Dim sLayerName As String
Dim FeatureLayer As IFeatureLayer
Dim SrchStr As String
Dim i As Integer
'Layer name to look for in the TOC
sLayerName = "PLSS"
'Finds the layer in the TOC
For i = 0 To pMap.LayerCount - 1
If pMap.Layer(i).Name = sLayerName Then
FeatureLayer = pMap.Layer(i)
Exit For
End If
Next i
'Checks to make sure "PLSS" layer is available
If pActiveView Is Nothing OrElse FeatureLayer Is Nothing Then
MsgBox("Please add the PLSS layer and select a feature", MsgBoxStyle.Information, "PLSS")
Return
End If
Dim featureSelection As ESRI.ArcGIS.Carto.IFeatureSelection = TryCast(FeatureLayer, ESRI.ArcGIS.Carto.IFeatureSelection) ' Dynamic Cast
'Sets the search string from the combobox inputs
SrchStr = "PARCEL_ID = '" & sSection & "'AND TWP =" & sTwp & " AND TWPD ='" & sTwpD & "'AND RNG = " & sRng & "AND RNGD = '" & sRngD & "'"
'A series of checks to make sure all necessary inputs are in place - error checking
If SrchStr Is Nothing Then
MsgBox("Please make a selection in every box", MsgBoxStyle.Information, "PLSS")
Return
ElseIf sSection Is Nothing Then
MsgBox("Please enter a section", MsgBoxStyle.Information, "PLSS")
Return
ElseIf sTwp Is Nothing Then
MsgBox("Please enter a township range", MsgBoxStyle.Information, "PLSS")
Return
ElseIf sTwpD Is Nothing Then
MsgBox("Please enter a township direction", MsgBoxStyle.Information, "PLSS")
Return
ElseIf sRng Is Nothing Then
MsgBox("Please enter a range", MsgBoxStyle.Information, "PLSS")
Return
ElseIf sRngD Is Nothing Then
MsgBox("Please enter a range direction", MsgBoxStyle.Information, "PLSS")
Return
Else 'If everything accounted for, move on.
End If
MsgBox("Finding your selection....Please wait", MsgBoxStyle.Information, "PLSS")
Dim queryFilter As ESRI.ArcGIS.Geodatabase.IQueryFilter = New ESRI.ArcGIS.Geodatabase.QueryFilterClass
queryFilter.WhereClause = SrchStr
' Invalidate only the selection cache. Flag the original selection
pActiveView.PartialRefresh(ESRI.ArcGIS.Carto.esriViewDrawPhase.esriViewGeoSelection, Nothing, Nothing)
' Perform the selection
featureSelection.SelectFeatures(queryFilter, ESRI.ArcGIS.Carto.esriSelectionResultEnum.esriSelectionResultNew, False)
' Flag the new selection
pActiveView.PartialRefresh(ESRI.ArcGIS.Carto.esriViewDrawPhase.esriViewGeoSelection, Nothing, Nothing)
End Sub
Public Sub New(ByVal hook As Object)
' This call is required by the Windows Form Designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
Me.Hook = hook
End Sub
Private m_hook As Object
''' <summary>
''' Host object of the dockable window
''' </summary>
Public Property Hook() As Object
Get
Return m_hook
End Get
Set(ByVal value As Object)
m_hook = value
End Set
End Property
''' <summary>
''' Implementation class of the dockable window add-in. It is responsible for
''' creating and disposing the user interface class for the dockable window.
''' </summary>
Public Class AddinImpl
Inherits ESRI.ArcGIS.Desktop.AddIns.DockableWindow
Private m_windowUI As SLO_DockableWindow1
Protected Overrides Function OnCreateChild() As System.IntPtr
m_windowUI = New SLO_DockableWindow1(Me.Hook)
Return m_windowUI.Handle
End Function
Protected Overrides Sub Dispose(ByVal Param As Boolean)
If m_windowUI IsNot Nothing Then
m_windowUI.Dispose(Param)
End If
MyBase.Dispose(Param)
End Sub
End Class
Private Sub Sec_cbo_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Sec_cbo.SelectedIndexChanged
sSection = Sec_cbo.Text
End Sub
Private Sub Twp_cbo_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Twp_cbo.SelectedIndexChanged
sTwp = Twp_cbo.Text
End Sub
Private Sub TwpD_cbo_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TwpD_cbo.SelectedIndexChanged
sTwpD = TwpD_cbo.Text
End Sub
Private Sub Rng_cbo_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Rng_cbo.SelectedIndexChanged
sRng = Rng_cbo.Text
End Sub
Private Sub RngD_cbo_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RngD_cbo.SelectedIndexChanged
sRngD = RngD_cbo.Text
End Sub
End Class
_______________________________________________________________________
Button.vb:
Public Class Find_PLSS_btn
Inherits ESRI.ArcGIS.Desktop.AddIns.Button
Public Sub New()
End Sub
Protected Overrides Sub OnClick()
Dim dockWindow As ESRI.ArcGIS.Framework.IDockableWindow
' Only get/create the dockable window if it's not there
If dockWindow Is Nothing Then
Dim dockWinID As UID = New UIDClass()
dockWinID.Value = My.ThisAddIn.IDs.SLO_DockableWindow1
dockWindow = My.ArcMap.DockableWindowManager.GetDockableWindow(dockWinID)
End If
dockWindow.Show((Not dockWindow.IsVisible()))
My.ArcMap.Application.CurrentTool = Nothing
End Sub
Protected Overrides Sub OnUpdate()
Enabled = My.ArcMap.Application IsNot Nothing
End Sub
End Class