| View previous topic :: View next topic |
| Author |
Message |
kuze Guest
|
Posted: Sun Dec 14, 2003 7:19 pm Post subject: StringGrid Problem |
|
|
Hi,
I have a question, probably a very simple question but I have no clue how to
get around the problem.
I have a string grid with the following code snippet
TStringGrid *StringGrid1;
StringGrid1->ColCount = 7;
StringGrid1->RowCount = 7;
I use a for loop to populate the cells.
Now the problem is I want to disable the Cells[4][4] to Cells[6][6].
I thought I would be able to use a statement like
StringGrid1->Cells[4][4]->Enabled = false;
But that does not work. I am looking through the help files and it seems I
have to use a control such as CanFocus, but I do not know much about that.
Any and all assistance is very much welcome.
Thanks
|
|
| Back to top |
|
 |
Rodolfo Frino Guest
|
Posted: Mon Dec 15, 2003 1:24 am Post subject: Re: StringGrid Problem |
|
|
| Quote: | Now the problem is I want to disable the Cells[4][4] to Cells[6][6].
|
Do you want to prevent writing to a cell when the cell is disabled?
If not, what is the behaviour do you wish to achieve when the cell is
disabled?
Rodolfo
|
|
| Back to top |
|
 |
kuze Guest
|
Posted: Thu Dec 18, 2003 4:18 am Post subject: Re: StringGrid Problem |
|
|
Hi Thanks for the response. Basically, I want to disable the cell so as to
prevent writing to it. Basically, it should not accept any input to receive
focus.
Thanks
"Rodolfo Frino" <MenInBlack (AT) nowhere (DOT) com> wrote
| Quote: | Now the problem is I want to disable the Cells[4][4] to Cells[6][6].
Do you want to prevent writing to a cell when the cell is disabled?
If not, what is the behaviour do you wish to achieve when the cell is
disabled?
Rodolfo
|
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Thu Dec 18, 2003 5:28 am Post subject: Re: StringGrid Problem |
|
|
"kuze" <kuzemdoo (AT) hotmail (DOT) com> wrote
| Quote: | Hi Thanks for the response. Basically, I want to disable the cell
so as to prevent writing to it. Basically, it should not accept any
input to receive focus.
|
One way to do that would be to derive a new class from TStringGrid and
override the CanEditModify() method. When called, it can check what the
current Row and Col settings are, and if you do not want to allow editing
for that particular call, simply return false.
Gambit
|
|
| Back to top |
|
 |
Rodolfo Frino - Macrosoft Guest
|
Posted: Fri Dec 19, 2003 5:32 am Post subject: Re: StringGrid Problem |
|
|
I think that has already been superbly answered by JD in the language
newsgroup.
Rodolfo
"kuze" <kuzemdoo (AT) hotmail (DOT) com> wrote
| Quote: | Hi Thanks for the response. Basically, I want to disable the cell so as to
prevent writing to it. Basically, it should not accept any input to
receive
focus.
Thanks
|
|
|
| Back to top |
|
 |
|