首页上一页 1 下一页尾页 1 条记录 1/1页
廖
发表在VB答疑区
2010-09-19
是否精华
是
否
版块置顶:
是
否
可不可以将视频学VB中MR\Instance\12\12.9中的File1_Click事件代码换成下面的更直观些。
Private Sub File1_Click()
On Error GoTo 1
Dim i As Integer, j As Boolean, k As Boolean, l As Boolean, m As Boolean
i = FileSystem.GetAttr(File1.Path & "\" & File1.FileName)
j = i Xor vbArchive
If j = 0 Then Chk_Archive.Value = 1
Else
Chk_Archive.Value = 0
End If
k = i Xor vbSystem
If k = 0 Then
Chk_System.Value = 1
Else
Chk_System.Value = 0
End If
l = i Xor vbHidden
If l = 0 Then
Chk_Hidden.Value = 1
Else
Chk_Hidden.Value = 0
End If
m = i Xor vbReadOnly
If m = 0 Then
Chk_RaedOnly.Value = 1
Else
Chk_RaedOnly.Value = 0
End If
Exit Sub
1:
MsgBox Err.Description, vbCritical
End Sub
Private Sub File1_Click()
On Error GoTo 1
Dim i As Integer, j As Boolean, k As Boolean, l As Boolean, m As Boolean
i = FileSystem.GetAttr(File1.Path & "\" & File1.FileName)
j = i Xor vbArchive
If j = 0 Then Chk_Archive.Value = 1
Else
Chk_Archive.Value = 0
End If
k = i Xor vbSystem
If k = 0 Then
Chk_System.Value = 1
Else
Chk_System.Value = 0
End If
l = i Xor vbHidden
If l = 0 Then
Chk_Hidden.Value = 1
Else
Chk_Hidden.Value = 0
End If
m = i Xor vbReadOnly
If m = 0 Then
Chk_RaedOnly.Value = 1
Else
Chk_RaedOnly.Value = 0
End If
Exit Sub
1:
MsgBox Err.Description, vbCritical
End Sub