Hallo, can someone help me out:
I have a stringgrid, where i display hex data of a file( a hexeditor), and i need to change the color of the cell, if i chenge the data inside it. How can i do that??
Thanks.
mmx64
0
Newbie Poster
Recommended Answers
Jump to PostHmm, sorry. I thought I responded to this already.
You'll have to set the DefaultDrawing property to false, and provide a method for the OnDrawCell event.
Here's an example I googled.
http://bcbjournal.com/bcbcaq/index.php?loc=grids&caq=48
(It is in BC++, but all the essentials are the same, so you shouldn't …
Jump to PostIn your OnDrawCell event you need to choose your color based on whatever criteria you are interested in. The criteria may apply to more than one cell, even.
procedure TForm1.sGridDrawCell( Sender: TObject; ACol, ARow: Longint; Rect: TRect; State: TGridDrawState ); var savefg: TColor; savebg: TColor; begin // …
Jump to Post1. Yep. Exactly. Sender should be sGrid.
2. Oops! It should be
sGrid.DrawCell( ACol, ARow, Rect, State );
I just typed this stuff in off the top of my head...You can resolve things like this by placing the cursor over the name "DrawCell" and pressing F1. …
All 10 Replies
Duoas
1,025
Postaholic
Featured Poster
mmx64
0
Newbie Poster
Duoas
1,025
Postaholic
Featured Poster
mmx64
0
Newbie Poster
Duoas
1,025
Postaholic
Featured Poster
mmx64
0
Newbie Poster
Duoas
1,025
Postaholic
Featured Poster
mmx64
0
Newbie Poster
Duoas
1,025
Postaholic
Featured Poster
mmx64
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.