⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 baizhu.frm

📁 使用VB和MAPX开发的一个比较通用的实例程序
💻 FRM
字号:
VERSION 5.00
Begin VB.Form biaozhu 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "标注字段"
   ClientHeight    =   2985
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   4335
   LinkTopic       =   "Form2"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2985
   ScaleWidth      =   4335
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton Command2 
      Caption         =   "取消"
      Height          =   375
      Left            =   3120
      TabIndex        =   2
      Top             =   1680
      Width           =   1215
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确定"
      Height          =   375
      Left            =   3120
      TabIndex        =   1
      Top             =   480
      Width           =   1215
   End
   Begin VB.ListBox lstFieldName 
      Height          =   2580
      Left            =   0
      TabIndex        =   0
      Top             =   360
      Width           =   3135
   End
   Begin VB.Label Label1 
      Caption         =   "Label1"
      Height          =   375
      Left            =   0
      TabIndex        =   3
      Top             =   0
      Width           =   3135
   End
End
Attribute VB_Name = "biaozhu"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim df As MapXLib.Field
Set df = Form1.Map1.Datasets.Item(lname).Fields.Item(Trim(lstFieldName.Text))
Set Form1.Map1.Layers.Item(lname).LabelProperties.Dataset = Form1.Map1.Datasets.Item(lname)
Set Form1.Map1.Layers.Item(lname).LabelProperties.DataField = df
Form1.Map1.CurrentTool = miLabelTool
Unload Me
End Sub

Private Sub Command2_Click()
Unload Me
End Sub

Private Sub Form_Load()
Dim rs As ADODB.Recordset
Dim fis As ADODB.Field
Set rs = Form1.Adodc1.Recordset
For Each fis In rs.Fields
lstFieldName.AddItem fis.Name
Next fis
lstFieldName.RemoveItem 0
lstFieldName.ListIndex = 0
Label1.Caption = "当前层字段:" + lname
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -