📄 attributesdlg.frm
字号:
VERSION 5.00
Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.2#0"; "COMCTL32.OCX"
Begin VB.Form AttributesDlg
BorderStyle = 3 'Fixed Dialog
Caption = "Attribute"
ClientHeight = 4560
ClientLeft = 45
ClientTop = 330
ClientWidth = 6030
LinkTopic = "Attribute"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4560
ScaleWidth = 6030
ShowInTaskbar = 0 'False
StartUpPosition = 3 'Windows Default
Begin VB.TextBox AttrName
Height = 285
Left = 1080
Locked = -1 'True
TabIndex = 6
TabStop = 0 'False
Top = 3120
Width = 4815
End
Begin VB.CommandButton UpdateBtn
Caption = "Update"
Default = -1 'True
Height = 375
Left = 1560
TabIndex = 1
Top = 4080
Width = 1335
End
Begin VB.TextBox AttrValue
Height = 285
Left = 1080
TabIndex = 3
Top = 3480
Width = 4815
End
Begin VB.CommandButton CloseBtn
Caption = "Close"
Height = 375
Left = 120
TabIndex = 0
Top = 4080
Width = 1335
End
Begin ComctlLib.ListView AttrList
Height = 2895
Left = 120
TabIndex = 2
Top = 120
Width = 5775
_ExtentX = 10186
_ExtentY = 5106
View = 3
LabelEdit = 1
LabelWrap = -1 'True
HideSelection = -1 'True
_Version = 327682
ForeColor = -2147483640
BackColor = -2147483643
BorderStyle = 1
Appearance = 1
NumItems = 2
BeginProperty ColumnHeader(1) {0713E8C7-850A-101B-AFC0-4210102A8DA7}
Key = ""
Object.Tag = ""
Text = "Name"
Object.Width = 2540
EndProperty
BeginProperty ColumnHeader(2) {0713E8C7-850A-101B-AFC0-4210102A8DA7}
SubItemIndex = 1
Key = ""
Object.Tag = ""
Text = "Value"
Object.Width = 2540
EndProperty
End
Begin VB.Label Label2
Caption = "Wert"
Height = 255
Left = 240
TabIndex = 5
Top = 3480
Width = 495
End
Begin VB.Label Label1
Caption = "Attribut"
Height = 255
Left = 240
TabIndex = 4
Top = 3120
Width = 615
End
End
Attribute VB_Name = "AttributesDlg"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public Obj As Object
Private Sub CloseBtn_Click()
Unload Me
End Sub
Private Sub Form_Load()
' Init Layout
Dim w As Long
w = AttrList.Width - 1000
AttrList.ColumnHeaders(1).Width = w / 2
AttrList.ColumnHeaders(2).Width = w / 2
AttrList.HideSelection = False
' und nun die Daten
Dim onemore As Boolean
Dim item As ListItem
Dim AttrNameStr As String
Dim AttrValStr As String
On Error GoTo Error1
onemore = Obj.GetFirstAttribute(AttrNameStr, AttrValStr)
While onemore
Set item = AttrList.ListItems.Add(, , AttrNameStr)
item.Key = AttrNameStr
item.SubItems(1) = AttrValStr
onemore = Obj.GetNextAttribute(AttrNameStr, AttrValStr)
Wend
Exit Sub
Error1:
CatchError
CloseBtn_Click
End Sub
Private Sub UpdateBtn_Click()
Dim item As ListItem
On Error Resume Next
Obj.Attribute(AttrName.Text) = AttrValue.Text
If Not CatchError Then
Set item = AttrList.ListItems(AttrName.Text)
item.SubItems(1) = Obj.Attribute(AttrName.Text)
End If
End Sub
Private Sub AttrList_MouseUp(button As Integer, shift As Integer, x As Single, y As Single)
UpdateEdit
End Sub
Private Sub AttrList_KeyUp(keycode As Integer, shift As Integer)
UpdateEdit
End Sub
Private Sub UpdateEdit()
Dim item As ListItem
On Error Resume Next
If AttrList.ListItems.Count = 0 Then Exit Sub
Set item = AttrList.SelectedItem
AttrName.Text = item.Text
AttrValue.Text = item.SubItems(1)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -