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: Do 16.06.05 08:34 
Hallöchen, ich würd gern wissen wie kann ich die ColorBox initialisieren mit anderen Farben?
Im ObjectInspector?

Ach hat sich erledigt ich kann ja unter Style einstellen, so daß ich "Individuell.." zur Auswahl habe,
das reicht schon mal!


Zuletzt bearbeitet von JRegier am Do 16.06.05 08:49, insgesamt 1-mal bearbeitet
JRegier Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1268

Win XP Home, Prof, 2003 Server
D6 Enterprise
BeitragVerfasst: Do 16.06.05 08:48 
Titel: Re: ColorBox mit anderen Farben initialisieren?
user profile iconJRegier hat folgendes geschrieben:
Hallöchen, ich würd gern wissen wie kann ich die ColorBox initialisieren mit anderen Farben?
Im ObjectInspector?

Ach hat sich erledigt ich kann ja unter Style einstellen, so daß ich "Individuell.." zur Auswahl habe,
das reicht schon mal!


Ah, hab jetzt ein weiteres Problem! In der ColorBox läßt sich nicht DragMode einstellen!
Ich wollte per Drag Drop Komponenten Farbe setzen! Wie geht das mit der ColorBox wenn
DragMode fehlt?
Mottor
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 19



BeitragVerfasst: Do 16.06.05 17:57 
csOwnerDrawFixed und csOwnerDrawVariable sind schuldig.
Versuch das:
ausblenden volle Höhe 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:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
unit ColorBoxTest;

interface

uses
  SysUtils, Classes, Controls, StdCtrls, ExtCtrls,Messages;

type
  TColorBoxTest = class(TColorBox)
  private
  protected
    procedure WMLButtonDown(var Message: TWMLButtonDown); message WM_LBUTTONDOWN;
  public
  published
    property DragMode;
    property DragKind;
  end;

procedure Register;

implementation

uses Types,Windows;
procedure Register;
begin
  RegisterComponents('Test', [TColorBoxTest]);
end;

{ TColorBoxTest }

procedure TColorBoxTest.WMLButtonDown(var Message: TWMLButtonDown);
var r: TRect;
begin
  if DragMode = dmAutomatic then begin
    r := ClientRect;                           
    r.Right := r.Left+r.Bottom-r.Top;
    InflateRect(r,-2,-2);
    if PtInRect(r,Point(Message.XPos,Message.YPos)) then  // Mouse is over the color
    begin
      SetFocus;
      BeginDrag(False);
      Exit;
    end;
  end;
  inherited;
end;

end.
JRegier Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1268

Win XP Home, Prof, 2003 Server
D6 Enterprise
BeitragVerfasst: Do 16.06.05 18:01 
Vielen Dank, Partner! :wink: