📄 frmopenattrible.frm
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MsFlxGrd.OCX"
Begin VB.Form frmOpenAttrible
Caption = "打开属性表"
ClientHeight = 6030
ClientLeft = 60
ClientTop = 345
ClientWidth = 9690
LinkTopic = "Form1"
ScaleHeight = 6030
ScaleWidth = 9690
StartUpPosition = 3 'Windows Default
Begin VB.OptionButton OptionSelect
Caption = "选择记录"
Height = 375
Left = 1800
TabIndex = 3
Top = 5400
Width = 1095
End
Begin VB.OptionButton OptionAll
Caption = "全部记录"
Height = 375
Left = 480
TabIndex = 2
Top = 5400
Width = 1095
End
Begin VB.CommandButton CommandCancel
Caption = "取消"
Height = 375
Left = 6960
TabIndex = 1
Top = 5400
Width = 1455
End
Begin MSFlexGridLib.MSFlexGrid MSFlexGrid
Height = 5055
Left = 0
TabIndex = 0
Top = 120
Width = 9735
_ExtentX = 17171
_ExtentY = 8916
_Version = 393216
FixedCols = 0
AllowUserResizing= 1
End
End
Attribute VB_Name = "frmOpenAttrible"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub CommandCancel_Click()
Unload Me
End Sub
Private Sub Form_Load()
Dim pFeatureLayer As IFeatureLayer
Dim pDataset As IDataset
On Error Resume Next
' On Error GoTo StartEditing_err
If m_pCurrentLayer Is Nothing Then Exit Sub
If Not TypeOf m_pCurrentLayer Is IGeoFeatureLayer Then Exit Sub
Set pFeatureLayer = m_pCurrentLayer
Set pDataset = pFeatureLayer.FeatureClass
If pDataset Is Nothing Then Exit Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim i As Long, j As Long
MSFlexGrid.Rows = 2
MSFlexGrid.Cols = pFeatureLayer.FeatureClass.Fields.FieldCount
For i = 0 To pFeatureLayer.FeatureClass.Fields.FieldCount - 1
MSFlexGrid.TextMatrix(0, i) = pFeatureLayer.FeatureClass.Fields.Field(i).AliasName
Next i
Dim pQFilt As IQueryFilter
Set pQFilt = New QueryFilter
'pQFilt.whereClause
'pQFilt.whereClause = "subtype = 'COM'"
MSFlexGrid.Rows = pFeatureLayer.FeatureClass.FeatureCount(pQFilt) + 1
i = 1
For i = 1 To pFeatureLayer.FeatureClass.FeatureCount(pQFilt)
'While pFeatureLayer.FeatureClass.GetFeature(i).Shape.IsEmpty
For j = 0 To pFeatureLayer.FeatureClass.Fields.FieldCount - 1
'MSFlexGrid.TextMatrix(i + 1, j) = pFeatureLayer.FeatureClass.GetFeature(i).Value(j)
'If pFeatureLayer.FeatureClass.Fields.Field(j).Type = 7 Then
' MSFlexGrid.TextMatrix(i + 1, j) = CStr(pFeatureLayer.FeatureClass.GetFeature(i).Shape.GeometryType)
'Else
MSFlexGrid.TextMatrix(i + 1, j) = CStr(pFeatureLayer.FeatureClass.GetFeatu1re(i).Value(j)) + ""
' End If
Next j
' i = i + 1
' Wend
Next i
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Exit Sub
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -