U units Unregistered / Unconfirmed GUEST, unregistred user! 2005-07-29 #1 我知道Delphi里面是这样判断的: if Form1.Components is TCustomComboBox 那么相应的在BCB里面应该如何判断呢?请教!
U units Unregistered / Unconfirmed GUEST, unregistred user! 2005-07-29 #2 我知道Delphi里面是这样判断的: if Form1.Components is TCustomComboBox 那么相应的在BCB里面应该如何判断呢?请教!
Z zjjzl Unregistered / Unconfirmed GUEST, unregistred user! 2005-07-29 #5 Form1.Components.InheritsFrom(__classid(TCustomComboBox ))
F fbms Unregistered / Unconfirmed GUEST, unregistred user! 2005-08-30 #6 if(String(Form1->Components->ClassName()) == "TCustomComboBox"
C chenybin Unregistered / Unconfirmed GUEST, unregistred user! 2005-08-30 #7 标准C++的RTTI是用dynamic_case,查下帮助就知道了,我比较喜欢用这种方式 ----------转自网络 for(int i=0;i<Form1->ComponentCount;i++) { if(dynamic_cast<TEdit *>(Components)) ((TEdit *)Components)->Enabled=true; else if (dynamic_cast<TComboBox *>(Components)) ((TComboBox *)Components)->Enabled=true; } 还有一种就是 for(int i=0;i<Form1->ComponentCount;i++) { if(Components->ClassNameIs("TEdit") (TEdit *)Components->Enabled=true; else if (Components->ClassNameIs("TComboBox") (TComboBox*)Components->Enabled=true; }
标准C++的RTTI是用dynamic_case,查下帮助就知道了,我比较喜欢用这种方式 ----------转自网络 for(int i=0;i<Form1->ComponentCount;i++) { if(dynamic_cast<TEdit *>(Components)) ((TEdit *)Components)->Enabled=true; else if (dynamic_cast<TComboBox *>(Components)) ((TComboBox *)Components)->Enabled=true; } 还有一种就是 for(int i=0;i<Form1->ComponentCount;i++) { if(Components->ClassNameIs("TEdit") (TEdit *)Components->Enabled=true; else if (Components->ClassNameIs("TComboBox") (TComboBox*)Components->Enabled=true; }