AGB  ·  Datenschutz  ·  Impressum  







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

Probleme mit TRichEdit

Ein Thema von Jonas · begonnen am 31. Dez 2005 · letzter Beitrag vom 15. Jan 2006
 
xaromz

Registriert seit: 18. Mär 2005
1.682 Beiträge
 
Delphi 2006 Enterprise
 
#10

Re: Probleme mit TRichEdit

  Alt 14. Jan 2006, 20:53
Hallo,

versuch doch mal folgendes:
Delphi-Quellcode:
unit gsticky;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, StdCtrls, ComCtrls;

type
  Tsticky = class(TCustomControl)
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
    procedure Paint; override;
  private
    FirstDraw: boolean;
    stickynote: TRichEdit;
    procedure SetParent(AParent: TWinControl); override; // <--------
  public
  end;

constructor Tsticky.Create(AOwner: TComponent);
begin
inherited Create(Aowner);
imageresDLL := LoadLibrary(PChar('imageres.dll'));
  stickynote := TRichEdit.Create(self);
  stickynote.Parent := Self;
end;

procedure Tsticky.SetParent(AParent: TWinControl);
begin
  inherited SetParent(AParent);

  if (AParent = nil) then
    Exit;

  stickynote.Enabled := true;
  stickynote.Left := 60;
  stickynote.Top := 10;
  stickynote.Width := 80;
  stickynote.Height := 45;
  stickynote.Color := clLime;
  stickynote.BorderStyle := BsNone;
end;
Damit setzt Du die Eigenschaften erst, wenn Deine Komponente TSticky wirklich ein Parent-Control hat.

Gruß
xaromz
// Edit: Fehler korrigiert
  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 15:35 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz