Please, Can anyone help me with this syntax problem!
I have a StringGrid with the main data centred, plus I overwrite the bottom of the cell with info in grey. Problem is, when I edit the cell the data goes left and my grey info gets wiped out, so I need to reposition and resize the InplaceEditor within the cell.
It must be possible as I've found Delphi examples of similar stuff but can't get it to work in bcb. The following is my class definition and simply a button to try and access the left & width properties, but it gives me an access violation error:-
class TMyGrid : public TStringGrid
{
public:
__fastcall TMyGrid(
TComponent* AOwner) :
TStringGrid(AOwner) {}
__property InplaceEditor;
};
void __fastcall TForm1::Button1Click(TObject *Sender)
{
int EdWidth = TMyGrid(StringGrid1).InplaceEditor->Width;
int EdLeft = TMyGrid(StringGrid1).InplaceEditor->Left;
String s = "Width=" + IntToStr(EdWidth) + " Left=" + IntToStr(EdLeft);
}
What am I doing wrong???
I have a StringGrid with the main data centred, plus I overwrite the bottom of the cell with info in grey. Problem is, when I edit the cell the data goes left and my grey info gets wiped out, so I need to reposition and resize the InplaceEditor within the cell.
It must be possible as I've found Delphi examples of similar stuff but can't get it to work in bcb. The following is my class definition and simply a button to try and access the left & width properties, but it gives me an access violation error:-
class TMyGrid : public TStringGrid
{
public:
__fastcall TMyGrid(
TComponent* AOwner) :
TStringGrid(AOwner) {}
__property InplaceEditor;
};
void __fastcall TForm1::Button1Click(TObject *Sender)
{
int EdWidth = TMyGrid(StringGrid1).InplaceEditor->Width;
int EdLeft = TMyGrid(StringGrid1).InplaceEditor->Left;
String s = "Width=" + IntToStr(EdWidth) + " Left=" + IntToStr(EdLeft);
}
What am I doing wrong???