[vb.net] Interaction.CallByName(Object, String, CallType, Object[]) 메서드
하나를하더라도최선을
2020-04-24 10:39:16
57,182
0
0
개체의 메서드를 실행하거나 개체의 속성을 설정 또는 반환합니다.
C#
public static object CallByName (object ObjectRef, string ProcName, Microsoft.VisualBasic.CallType UseCallType, params object[] Args);매개 변수
반환
예외
예제
다음 예제에서 첫 번째 줄은 CallByName를 사용 하 여 입력란의 Text 속성을 설정 하 고, 두 번째 줄은 Text 속성의 값을 검색 하 고, 세 번째 줄은 Move 메서드를 호출 하 여 텍스트 상자를 이동 합니다.
VB
' Imports statements must be at the top of a module.
Imports Microsoft.VisualBasic.CallType
다음 예제에서는 CallByName 함수를 사용 하 여 컬렉션 개체의 Add 및 Item 메서드를 호출 합니다.
VB
Public Sub TestCallByName2()
Dim col As New Collection()
'Store the string "Item One" in a collection by
'calling the Add method.
CallByName(col, "Add", CallType.Method, "Item One")
'Retrieve the first entry from the collection using the
'Item property and display it using MsgBox().
MsgBox(CallByName(col, "Item", CallType.Get, 1))
End Sub
설명
CallByName 함수는 런타임에 속성을 가져오거나 속성을 설정 하거나 메서드를 호출 하는 데 사용 됩니다.