AGB  ·  Datenschutz  ·  Impressum  







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

ListBox Weiterentwicklung

Ein Thema von Alex_ITA01 · begonnen am 28. Mai 2004 · letzter Beitrag vom 2. Jun 2004
 
Alex_ITA01

Registriert seit: 22. Sep 2003
1.134 Beiträge
 
Delphi 12 Athens
 
#9

Re: ListBox Weiterentwicklung

  Alt 2. Jun 2004, 15:34
OK das mit den 2 Eigenschaften und dem + davor habe ich hinbekommen nur will ich jetzt wenn visible auf True gesetzt wird, auch die Horizontale Scrollbar angezeigt wird
Nur bei mir kennt er Handle nicht und ich weiß nicht wie ich es 'bekomme'

Delphi-Quellcode:
unit ColorListBox1;

interface

uses
  SysUtils, Classes, Controls, StdCtrls, Graphics, Windows, Messages;

type
  TScroll = class(TGraphicsObject)
  private
    FVisible : Boolean;
    FLength : Integer;
    procedure SetVisible(Value : Boolean);
    procedure SetLength (Value : Integer);
  protected

  public
    constructor Create;
  published
    property Visible : Boolean read FVisible write SetVisible default False;
    property Length : Integer read FLength write SetLength default 0;
  end;

  MyColorListBox1 = class(TListBox)
  private
    { Private-Deklarationen }
    FScrollbar : TScroll;
    procedure SetScrollBar (Value : TScroll);
  protected
    { Protected-Deklarationen }
  public
    { Public-Deklarationen }
    constructor Create(AOwner:TComponent); override;
    destructor Destroy; override;
  published
    { Published-Deklarationen }
    property Scrollbar : TScroll read FScrollbar write SetScrollBar;
  end;

procedure Register;
{ ----------------------------------------------------------------------------- }
implementation
{ ----------------------------------------------------------------------------- }
procedure Register;
begin
  RegisterComponents('Beispiele', [MyColorListBox1]);
end;
{ ----------------------------------------------------------------------------- }
{ ColorListBox1 }
{ ----------------------------------------------------------------------------- }
constructor MyColorListBox1.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
  Width := 100;
  Height := 100;
  FScrollbar := TScroll.Create;
end;
{ ----------------------------------------------------------------------------- }
destructor MyColorListBox1.Destroy;
begin
  FScrollbar.Free;
  inherited Destroy;
end;
{ ----------------------------------------------------------------------------- }
{ TScroll }
{ ----------------------------------------------------------------------------- }
constructor TScroll.Create;
begin
  inherited Create;
  FVisible := False;
  FLength := 0;
end;
{ ----------------------------------------------------------------------------- }
procedure TScroll.SetLength(Value: Integer);
begin
  if Value <> 0 then
    FLength := Value;
end;
{ ----------------------------------------------------------------------------- }
procedure TScroll.SetVisible(Value: Boolean);
begin
  if Value = True then
  begin
    FVisible := Value;
  end;
  if FLength = 0 then
    FLength := 100;
// SendMessage(FHandle, LB_SetHorizontalExtent,FLength,Longint(0));
{ Handle undefiniert !!!!! }
end;
{ ----------------------------------------------------------------------------- }
procedure MyColorListBox1.SetScrollBar(Value: TScroll);
begin
  if Value.FVisible = True then
  begin
    FScrollbar := Value;
    if Value.FLength = 0 then
      Value.FLength := 10;
    SendMessage(Handle, LB_SetHorizontalExtent,Value.FLength,Longint(0));
  end;
end;
{ ----------------------------------------------------------------------------- }
end.
Könnte ihr mir bitte helfen???
  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 12:40 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