Hi,
Have a problem, have been thrown into the deep end with borland C++ builder. The boss wants an AnsiString drop down list to appear in the object inspector and I do not know how to achieve this.
Have worked out how to put a single AnsiString into it and this is what I have so far for the drop down list...
within .h...
__published:
__property TStringList Words[int Index] = {read=GetWords, write=SetWords};
private:
TStringList* Words;
AnsiString __fastcall GetWord(int Index)
void __fastcall SetIndexName(int Index, AnsiString str)
Within cpp...
AnsiString __fastcall GetWord(int Index)
{
return FWord->String[Index];
}
void __fastcall SetIndexName(int Index, AnsiString str)
{
FWord->String[Index] = str;
}
I would have thought that something along these lines should produce the drop down list box, but evidently I have missed something. All I get is an out of bounds type error.
Any link to a suitable sample or advice appreciated.
Thanks in advance,
David B.
Have a problem, have been thrown into the deep end with borland C++ builder. The boss wants an AnsiString drop down list to appear in the object inspector and I do not know how to achieve this.
Have worked out how to put a single AnsiString into it and this is what I have so far for the drop down list...
within .h...
__published:
__property TStringList Words[int Index] = {read=GetWords, write=SetWords};
private:
TStringList* Words;
AnsiString __fastcall GetWord(int Index)
void __fastcall SetIndexName(int Index, AnsiString str)
Within cpp...
AnsiString __fastcall GetWord(int Index)
{
return FWord->String[Index];
}
void __fastcall SetIndexName(int Index, AnsiString str)
{
FWord->String[Index] = str;
}
I would have thought that something along these lines should produce the drop down list box, but evidently I have missed something. All I get is an out of bounds type error.
Any link to a suitable sample or advice appreciated.
Thanks in advance,
David B.