기관실 요금 시스템 - 대상 집합의 사용
1. 창 집합
유료 시스템에서 하나의 기능을 실현해야 한다. 하나의 창을 열 때 다른 창을 최소화해야 한다.구현은 다음과 같습니다.
Private Sub Form_Activate()
'
Dim frmCurr As Form
For Each frmCurr In Forms
If frmCurr.Name <> "frmMain" And frmCurr.Name <> "frmMainshow" And frmCurr.Name <> Me.Name Then
frmCurr.WindowState = 1
End If
Next frmCurr
End Sub 2. 컨트롤 집합
예를 들어 카드 번호를 제외한 다른 텍스트 상자를 모두 비우기: (두 가지 방법)
법1:
' ,
Dim myControl As Control
For Each myControl In Me.Controls
If TypeOf myControl Is TextBox Then
If myControl.Name <> "txtCardno" Then
myControl.Text = ""
End If
End If
Next 법2:
Dim myControl As Control
For Each myControl In Me.Controls
If TypeName(myControl) = "TextBox" Then
myControl.Text = ""
End If
Next