Public
Class
frm_selectAttributes
Dim
pMxDoc
As
IMxDocument
Dim
pMap
As
IMap
Dim
pFeatureLayer
As
IFeatureLayer
Public
Sub
New
()
InitializeComponent()
Dim
pTable
As
ITable
Dim
intLayer
As
Integer
pMxDoc = My.ArcMap.Application.Document
pMap = pMxDoc.FocusMap
intLayer = mod_AbschlussAufgabe.findLayerByName(
"SiB2011"
, pMap)
If
intLayer = -1
Then
MsgBox(
"Es existiert kein Layer mit dem Namen Städte!"
)
Exit
Sub
End
If
pFeatureLayer = pMap.Layer(intLayer)
pTable = pFeatureLayer
Dim
pTableSort
As
ITableSort =
New
TableSort
With
pTableSort
.Table = pTable
.Fields =
"KAT"
.Ascending(
"KAT"
) =
True
.CaseSensitive(
"KAT"
) =
True
End
With
pTableSort.Sort(
Nothing
)
Dim
pCursor
As
ICursor
pCursor = pTableSort.Rows
Dim
pRow
As
IRow
pRow = pCursor.NextRow
Dim
strOberKat
As
String
strOberKat =
""
Me
.lst_KAT_ID.Items.Clear()
Do
While
Not
pRow
Is
Nothing
If
(pRow.Value(22) <> strOberKat)
Then
strOberKat = pRow.Value(22)
Me
.lst_KAT_ID.Items.Add(strOberKat)
End
If
pRow = pCursor.NextRow
Loop
End
Sub