AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Combobox-Hilfe

Ein Thema von AeNima · begonnen am 12. Nov 2006 · letzter Beitrag vom 15. Nov 2006
 
AeNima

Registriert seit: 12. Nov 2006
2 Beiträge
 
#1

Combobox-Hilfe

  Alt 12. Nov 2006, 12:48
Also ich möchte ein Programm schreiben im Stil von Windows paint .
Ich hab eine farbpallette in einer combobox .
Nun möchte ich ,dass wenn ich die farbe auswähle, ich auch mit der Farbe male.
Delphi-Quellcode:
procedure TForm1.ComboBox1DrawItem(Control: TWinControl; Index: Integer;
  Rect: TRect; State: TOwnerDrawState);
begin

 with Control as TComboBox,Canvas do begin
    Brush.Color := clWhite;
    FillRect(Rect);
    InflateRect(Rect,-2,-2);
    Brush.Color := StrToInt(Items[Index]);
    FillRect(Rect);
  end;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
with ComboBox1.Items do begin
  Add(IntToStr(clRed));
  Add(IntToStr(clFuchsia));
  Add(IntToStr(clBlue));
  Add(IntToStr(clGreen));
  Add(IntToStr(clYellow));
end;
end;

procedure TForm1.Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
image1.canvas.pen.color:=clblue;
if a=1 then image1.canvas.lineto (x,y) ;
             image1.canvas.moveto (x,y);
label1.caption:=inttostr(x);
label2.caption:=inttostr(y);
end;
jede hilfe ist willkommen,denn ich komme mit meinem problem einfach nicht weiter
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 08:33 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz