Announcement

Collapse
No announcement yet.

Edit Farbig

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Edit Farbig

    Hi, Wie kann ich ein TEdit, das dne Focus hat, fargig machen?

  • #2
    Hi, Gnurl.

    So Etwas ähnliches hatten wir Hier schon einmal:

    <b>procedure</b> TForm1.ColorControl(Sender: TObject);
    <b>var</b>
    i : Integer;
    <b>begin</b>
    <b>for</b> I:= 0 <b>to</b> ControlCount -1 <b>do</b>
    <b>begin</b>
    <b>if</b> Controls[i] <b>is</b> TEdit <b>then</b>
    <b>begin</b>
    <b>if</b> (Controls[i] <b>as</b> TEdit).Focused <b>then</b>
    (Controls[i] <b>as</b> TEdit).Color := clBlue <span style="color:blue;">// Hier die Farbe eintragen</Span>
    <b>else</b>
    (Controls[i] <b>as</b> TEdit).Color:= clWhite;
    <b>end</b>;
    <b>end</b>;
    <b>end</b>;

    Um das zu verwenden:
    <b>procedure</b> TForm1.FormCreate(Sender: TObject);
    <b>begin</b>
    Screen.OnActiveControlChange := ColorControl;
    <b>end</b>;
    &#10
    If it's there and you can see it – it's REAL
    If it's there and you can't see it – it's TRANSPARENT
    If it's not there and you can see it – it's VIRTUAL
    If it's not there and you can't see it – it's GONE!

    Comment

    Working...
    X