BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

StringGrid Problem

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage)
View previous topic :: View next topic  
Author Message
kuze
Guest





PostPosted: Sun Dec 14, 2003 7:19 pm    Post subject: StringGrid Problem Reply with quote




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





PostPosted: Mon Dec 15, 2003 1:24 am    Post subject: Re: StringGrid Problem Reply with quote



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





PostPosted: Thu Dec 18, 2003 4:18 am    Post subject: Re: StringGrid Problem Reply with 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

"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





PostPosted: Thu Dec 18, 2003 5:28 am    Post subject: Re: StringGrid Problem Reply with quote


"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





PostPosted: Fri Dec 19, 2003 5:32 am    Post subject: Re: StringGrid Problem Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.