H
huzhicheng
Unregistered / Unconfirmed
GUEST, unregistred user!
小弟最近发现BusinessSkin控件外观不错,就拿来用用。但是今天搞了一天动态创建BusinessSkin控件中的TbsSKinScrollBar,发现情况是这样的。
当TbsSKinScrollBar通过代码创建时有如下问题:
无SkinData数据,即不设置皮肤时,显示正常,一旦设置皮肤以后,就无法正常显示,急,忘各位老大帮忙看看
贴上源代码及截图一张:
附图
http://bbs.2ccc.com/attachments/2008/huzhicheng_200812917524.jpg
当TbsSKinScrollBar通过代码创建时有如下问题:
无SkinData数据,即不设置皮肤时,显示正常,一旦设置皮肤以后,就无法正常显示,急,忘各位老大帮忙看看
贴上源代码及截图一张:
代码:
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, bsSkinCtrls, bsSkinBoxCtrls, StdCtrls, bsSkinHint, bsSkinData,
BusinessSkinForm;
type
TForm2 = class(TForm)
bsSkinGroupBox4: TbsSkinGroupBox;
bsSkinScrollBar10: TbsSkinScrollBar;
bsSkinScrollBox1: TbsSkinScrollBox;
bsSkinExPanel6: TbsSkinExPanel;
bsSkinExPanel2: TbsSkinExPanel;
bsSkinExPanel10: TbsSkinExPanel;
bsSkinGroupBox1: TbsSkinGroupBox;
Button1: TButton;
bsBusinessSkinForm1: TbsBusinessSkinForm;
TbsSDMain: TbsSkinData;
TbsCSLMain: TbsCompressedSkinList;
bsSkinHint1: TbsSkinHint;
bsSkinScrollBar1: TbsSkinScrollBar;
Button2: TButton;
Button3: TButton;
procedure Button3Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
bar : TbsSKinScrollBar;
implementation
{$R *.dfm}
procedure TForm2.Button1Click(Sender: TObject);
var
ctrl : TControl;
ctrl1 : TControl;
begin
bar := TbsSkinScrollBar.Create(self);
//bar.SkinData := TbsSDMain;
//bar.Update;
bsSkinGroupBox1.InsertControl(bar);
with bardo
begin
bar.Kind := sbVertical;
//bar.Update;
//both := false;
Align := alRight;
width := 19;
{Align := alNone;
Refresh;
Width := 19;
Refresh;
Align := alRight;}
//Kind := sbVertical;
{ Kind := sbVertical;
DefaultWidth := 19;
Align := alNone;
Refresh;
Width := 19;
Refresh;
Align := alLeft;
//SkinData := TbsSDMain;
//Parent := bsSkinGroupBox1;}
end;
//
ctrl := TbsSkinScrollBox.Create(self);
bsSkinGroupBox1.InsertControl(ctrl);
with TbsSkinScrollBox(ctrl)do
begin
Align := alCLient;
VScrollBar := bar;//bsSkinScrollBar1;//
end;
ctrl1 := TbsSkinGroupBox.Create(self);
TbsSkinScrollBox(ctrl).InsertControl(ctrl1);
with TbsSkinGroupBox(ctrl1)do
begin
Align := altop;
SkinData := TbsSDMain;
Caption := 'Panel1';
RollupMode := True;
end;
ctrl1 := TbsSkinGroupBox.Create(self);
TbsSkinScrollBox(ctrl).InsertControl(ctrl1);
with TbsSkinGroupBox(ctrl1)do
begin
Align := altop;
SkinData := TbsSDMain;
Caption := 'Panel2';
RollupMode := True;
end;
ctrl1 := TbsSkinGroupBox.Create(self);
TbsSkinScrollBox(ctrl).InsertControl(ctrl1);
with TbsSkinGroupBox(ctrl1)do
begin
Align := altop;
SkinData := TbsSDMain;
Caption := 'Panel12';
RollupMode := True;
end;
{ctrl1 := TbsSkinScrollBar.Create(self);//ctrl1 := bsSkinScrollBar10;
with TbsSkinScrollBar(ctrl1)do
begin
SkinData := TbsSDMain;
Kind := sbVertical;
//Visible := True;
{Align := alRight;
Both := False;
Kind := sbHorizontal;
DefaultHeight := 0;
DefaultWidth := 19;
Height := 200;
SkinData := TbsSDMain;
Kind := sbVertical;
end;
TbsSkinScrollBox(ctrl).VScrollBar := TbsSkinScrollBar(ctrl1);//bsSkinScrollBar1;//
bsSkinGroupBox1.InsertControl(ctrl1);
with TbsSkinScrollBar(ctrl1)do
begin
DefaultWidth := 19;
Align := alRight;
//SkinData := TbsSDMain;
//
//Kind := sbVertical;
//Visible := True;
{Align := alRight;
Both := False;
Kind := sbHorizontal;
DefaultHeight := 0;
DefaultWidth := 19;
Height := 200;
SkinData := TbsSDMain;
Kind := sbVertical;
end;
}
//bar.Show;
end;
procedure TForm2.Button2Click(Sender: TObject);
begin
{bar := TbsSkinScrollBar.Create(self);
bar.SkinData := TbsSDMain;
bar.Parent := self;
//bsSkinGroupBox1.InsertControl(bar);
bar.Kind := sbVertical;
bar.Both := false;
with bardo
begin
Height := 200;
Width := 19;
DefaultWidth := 19;
DefaultHeight:= 0;
//bar.Kind := sbVertical;
{bar.Update;
both := false;
Align := alRight;
width := 19;}
//end;
bar := TbsSkinScrollBar.Create(self);
bar.Assign(bsSkinScrollBar1);
ShowMessage(inttostr(bar.Height));
ShowMessage(inttostr(bar.Width));
ShowMessage(inttostr(bar.DefaultHeight));
ShowMessage(inttostr(bar.DefaultWidth));
end;
procedure TForm2.Button3Click(Sender: TObject);
begin
bar.SkinData:=bsSkinScrollBar1.SkinData;//);// := TbsSDMain;
end;
end.
http://bbs.2ccc.com/attachments/2008/huzhicheng_200812917524.jpg