could I write something like this?
'take a map
Private Sub Petadasar_Click()
Dim p1MxDoc As IMxDocument
Set p1MxDoc = ThisDocument
Dim p1GxDialog As IGxDialog
Set p1GxDialog = New GxDialog
p1GxDialog.AllowMultiSelect = True
p1GxDialog.Title = "Select Feature Classes to Add To Map"
Dim p1GxFilter As IGxObjectFilter
Set p1GxFilter = New GxFilterFeatureClasses
Set p1GxDialog.ObjectFilter = p1GxFilter
Dim p1GxObjects As IEnumGxObject
p1GxDialog.DoModalOpen Thisdocument.Parent.hWnd, p1GxObjects
If (p1GxObjects Is Nothing) Then Exit Sub
p1GxObjects.Reset
Dim p1Layer As IFeatureLayer
Dim p1GxDataset As IGxDataset
Set p1GxDataset = p1GxObjects.Next
Do Until (p1GxDataset Is Nothing)
Set p1Layer = New FeatureLayer
Set p1Layer.FeatureClass = p1GxDataset.Dataset
p1Layer.Name = p1Layer.FeatureClass.AliasName
p1MxDoc.FocusMap.Addlayer p1Layer
Set p1GxDataset = p1GxObjects.Next
Loop
p1MxDoc.ActiveView.PartialRefresh esriViewGeography, Nothing, Nothing
End Sub
'determining a process
Public Sub ComboBox1_DropButtonclick()
With ComboBox1
.AddItem "Flood region"
.AddItem "Urban distance"
.AddItem "Roadway distance"
.AddItem "Topograph"
.AddItem "Slope"
.AddItem "Environmental load"
End With
End Sub
Private Sub CommandButton2_Click()
Dim pDoc As IMxDocument
Dim pLayer As IFeatureLayer
Dim pFeatClass As IFeatureClass
Dim GP As Object
Set pDoc = ThisDocument
Set pLayer = pDoc.SelectedLayer
Set GP = CreateObject("esriGeoprocessing.GpDispatch.1")
If ComboBox1 = "Flood region" Then
GP.Buffer_analysis FCPath, pLayer, "50000"
end if
end sub