Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

drop down list in inspector

Status
Not open for further replies.

damichab

Programmer
Aug 2, 2004
3
0
0
AU
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.

 
If you want a drop down list, I think that you need first the list which you want to drop down.

I did a Gradient component which you can choose if you want the gradient Vertical or Horizontal.

like this:
enum TDirection { dHorizontal, dVertical};

__published:
__property TDirection Direction = { read=FDirection, write=SetDirection, default=dVertical};

And BCB automatically creates a DropDownList which contains both values (dVertical and dHorizontal)





--- LastCyborg ---
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top