Delphi Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreDelphi Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 31st, 2005, 08:34 PM
Nice Nice is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 48 Nice User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 24 m 10 sec
Reputation Power: 4
OnDrawCell problem

I am using the below code to write two small rectangles in two colors in column 1 of row 1.It writes them properly,but once the cell is clicked or form is moved, the rectangles disappear as I don't know how to store this value in StringGrid1->Cells[1][1].
What code should be added?


void __fastcall Form1::OnStringGrid1DrawCell(TObject *Sender,
int ACol, int ARow, TRect &Rect1, TGridDrawState State)
{

if(ACol == 1 && ARow == 1)
{
int i = 2;
int j = 4;
StringGrid1->Canvas->Brush->Color= clYellow;
StringGrid1->Canvas->FillRect(Rect(Rect1.Left+i,
Rect1.Top + 3, Rect1.Left+j, Rect1.Top + 11));
i=i+3;
j=j+3;
StringGrid1->Canvas->Brush->Color= clRed;
StringGrid1->Canvas->FillRect(Rect(Rect1.Left+i,
Rect1.Top + 3, Rect1.Left+j, Rect1.Top + 11));
}

}

Reply With Quote
  #2  
Old April 1st, 2005, 06:04 PM
Nice Nice is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 48 Nice User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 24 m 10 sec
Reputation Power: 4
Realised the problem was due to something else outside this piece of code :-)

problem solved !

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreDelphi Programming > OnDrawCell problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT