Autor Beitrag
JRegier
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1268

Win XP Home, Prof, 2003 Server
D6 Enterprise
BeitragVerfasst: So 28.08.05 10:57 
Hi, ich Zeichne in DBGrid in OnDrawColumnCell ein paar Bitmaps aber nach einem Doppelclick werden da
anstatt Bitmaps anzuzeigen der Inhalt angezeigt der selektiert ist! Ich habe aber auch ReadOnly := True
alles gesetzt! Wie kann ich diesen Effekt verhindern?
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: So 28.08.05 12:50 
Kannst du mal bitte den Sourcecode zeigen mit dem du auf dein Grid zeichnest?
JRegier Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1268

Win XP Home, Prof, 2003 Server
D6 Enterprise
BeitragVerfasst: So 28.08.05 13:16 
user profile iconTino hat folgendes geschrieben:
Kannst du mal bitte den Sourcecode zeigen mit dem du auf dein Grid zeichnest?

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
procedure TGroupBuilderFrame.GruppenbereicheDBGridDrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn;  State: GridDrawState);
var Rechte : TOperationTypes;
begin
   with GruppenbereicheDBGrid.Canvas do
   begin

   if(gdSelected in State)then
   Brush.Color := clLime
   else
   Brush.Color := clWhite;
   FillRect(Rect);

   if(DataCol = 2)then
   begin
   Rechte := TOperationTypes(Word(Column.Field.AsInteger));
   if(O_INSERT in Rechte)then
   Draw(Rect.Left+10,Rect.Top+2,InsertBmp);
   if(O_EDIT in Rechte)then
   Draw(Rect.Left+30, Rect.Top+2,EditBmp);
   if(O_DELETE in Rechte)then
   Draw(Rect.Left+50, Rect.Top+2,DeleteBmp);
   end
   else
   begin
   TextOut(Rect.Left+2, Rect.Top+2, Column.Field.AsString);
   end;
   end;
end;