Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ToolBar on component not visible

Status
Not open for further replies.

rkamarowski

Programmer
Apr 23, 2007
16
US
i'm creating a component based on TPanel. i can get a button to be visible, and a tmemo, but the toolbar is not visible. any ideas?

thanks,
bob k.

----------
unit KMPDGlobalLister;

interface

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

type
TKMPDGlobalLister = class(TPanel)
private
{ Private declarations }
// memGlobalLister: TMemo;
function GetGlobalName: string;
function GetLastNodeAccessed: string;
procedure SetGlobalName(sVal: string);
procedure SetLastNodeAccessed(sVal: string);

protected
{ Protected declarations }
public
{ Public declarations }
button: TButton;
// properites
property GlobalName: string read GetGlobalName write SetGlobalName;
property LastNodeAccessed: string read GetLastNodeAccessed write SetLastNodeAccessed;

// methods
Constructor Create(AnOwner:TComponent); Override;
Destructor Destroy; Override;

published
{ Published declarations }
memToolBar: TToolBar;

end;

procedure Register;

implementation

Constructor TKMPDGlobalLister.Create(AnOwner:TComponent);
begin
inherited Create(AnOwner);
Align:=alClient;
Anchors:=[akLeft,AkRight,akTop,akBottom];
Height:=200;
Width:=200;

memToolBar:=TToolBar.Create(Self);
memToolBar.Parent:=Self;
with memToolBar do
begin
Align:=alTop;
Anchors:=[akLeft,akRight,akTop];
Caption:='here ';
Enabled:=True;
Flat:=True;
Height:=30;
Visible:=True;
Width:=175;
end;
memToolBar.Show;

button:=TButton.Create(Self);
with button do
begin
Parent:=Self;
Caption:='button';
Enabled:=true;
Height:=20;
Width:=120;
ParentFont:=true;
show;
Visible:=true;
end;

{
// memo for text
memGlobalLister:=Tmemo.Create(Self);
memGlobalLister.Parent:=Self;
with memGlobalLister do
begin
BevelInner:=bvRaised;
BevelKind:=bkNone;
BevelOuter:=bvLowered;
// BorderStyle:=bsSingle;
Enabled:=True;
Height:=150;
ReadOnly:=True;
ScrollBars:=ssBoth;
Width:=150;
end; // memGlobalLister
memGlobalLister.Show;
}
end; // constructor

Destructor TKMPDGlobalLister.Destroy;
begin
inherited Destroy;
end;

// functions and procedures
function TKMPDGlobalLister.GetGlobalName: string;
begin
result:=GlobalName;
end;

function TKMPDGlobalLister.GetLastNodeAccessed: string;
begin
result:=LastNodeAccessed;
end;

procedure TKMPDGlobalLister.SetGlobalName(sVal: string);
begin
GlobalName:=sVal;
end;

procedure TKMPDGlobalLister.SetLastNodeAccessed(sVal: string);
begin
LastNodeAccessed:=sVal;
end;

procedure Register;
begin
RegisterComponents('Capacity Planning', [TKMPDGlobalLister]);
end;

end.
 
A quick check shows that if you just simply drop a tool bar onto a panel it dosent show up (but it is actualy visible), try seting the bevel properties or create some tool buttons to go on it



Steve [The sane]: Delphi a feersum engin indeed.
 
EdgeBorders was the key:

EdgeBorders:=[ebLeft,ebTop,ebRight,ebBottom];
EdgeOuter:=esRaised;

thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top