2013-06-24 1 views
0

폼의 컨트롤 유형을 찾아야합니다. 그것은 트 리뷰, 그룹 상자 또는VC++ 2010에서 폼의 컨트롤 유형을 찾는 방법

난 내 영어

+0

배열 ^Control_Type_Name = Properties-> Controls-> default [i] -> GetType() -> FullName-> 분할 ('.'); 문자열^Control_Type = Control_Type_Name [Control_Type_Name-> Length-1]; – Michail

+0

가능한 복제본 [C++/CLI-Question : C# "is"키워드와 동일한 것이 있습니까? 아니면 리플렉션을 사용해야합니까?] (http://stackoverflow.com/questions/712845/c-cli-question- is-there-an-the-c-sharp-is-keyword-do-do-i-hav) –

답변

0

양식의 컨트롤을 반복하고 대해서 typeof 및 사용할 수 있습니다 GetType을 드려 죄송

for(int i=0;i!=Properties->Controls->Count;i++) 
{ 
    Control^ Current_Control=Properties->Controls->default[i]; 
} 

을 사용하고 레이블은 다음과 같습니다

Public Sub ClearAll(ByVal frm As Control) 
    For Each C As Control In frm.Controls 
     Dim Ctl As Control = C 
     If ControlList.Contains(Ctl.GetType) Then 
      ClearAll(Ctl) 
     ElseIf (TypeOf Ctl Is TextBox) Then 
      Ctl.Text = "" 
     End If 
    Next 
    End Sub 

이 텍스트 상자를 검색하고 텍스트를 지 웁니다. 그룹 박스 또는 다른 컨테이너에 도달하면 그 안에있는 모든 텍스트 상자를 지 웁니다.

관련 문제