Guest:
Register
|
Login
|
Member List
|
Search
|
Statistics
|
FAQ
Language
----------
Simplifed Chinese
Traditional Chinese
English
CnPack Forum
»
CnVCL 组件包
» 求助,动态创建tcnbitbtn出问题,占资源100%
‹‹ Last Thread
|
Next Thread ››
Poll
Trade
Reward
Activity
Printable Version
|
Email to Friend
|
Subscription
|
Favorites
Subject: 求助,动态创建tcnbitbtn出问题,占资源100%
musesun
新警察
UID 45432
Digest Posts 0
Credits 6
Posts 2
点点分 6
Reading Access 10
Registered 2010-1-6
Status Offline
#1
Post at 2010-1-6 18:07
Profile
|
Blog
|
P.M.
求助,动态创建tcnbitbtn出问题,占资源100%
with TCnBitBtn.Create(Self) do
begin
Parent :=form1;
width := 143;
Height := 88;
Margins.Top:=1;
Margins.Bottom:=1;
Margins.Left:=1;
Margins.Right:=1;
AlignWithMargins:=True;
Visible := True;
Caption := FieldByName('name').AsString + ' (' + FieldByName('count').AsString + ')';
BtnColorStyle := bcsRed;
Name := 'c_' + trim(FieldByName('sn').AsString);
OnClick := coursebtnClick;
if FieldByName('count').AsInteger = 0 then
Enabled := false;
end;
delphi 2010下这段代码导致程序始终占资源100%,删除parent:=form1或者BtnColorStyle := bcsRed;
两行之一就正常了。
奇怪!
musesun
新警察
UID 45432
Digest Posts 0
Credits 6
Posts 2
点点分 6
Reading Access 10
Registered 2010-1-6
Status Offline
#2
Post at 2010-1-6 22:13
Profile
|
Blog
|
P.M.
定位到错误行:cnbuttons.pas
if FModernBtnStyle = bsModern then // 现代模式直接画,以避免圆角底色问题,但可能闪烁
begin
if FRoundCorner then // 圆角时处理透明问题
RenewBack;
把RenewBack关掉成功运行,缺点是没有圆角了,暂时先这样
Poll
Trade
Reward
Activity
CnPack Forum
CnPack English Forum
> CnWizards IDE Wizards
> CVSTracNT
> Announcements & Others
All times are GMT++8, the time now is 2024-11-22 07:11
Powered by
Discuz!
5.0.0
© 2001-2006
Comsenz Inc.
Processed in 0.008119 second(s), 8 queries , Gzip enabled
TOP
Clear Cookies
-
Contact Us
-
CnPack Website
-
Archiver
-
WAP
Member's CP Home
Edit Profile
Credits Transaction
Public User Groups
Buddy List
Main
Page Views
User Agents
Posts History
Top Forums
Top Threads
Post Ranking
Credit Ranking
Online Time
Team
Moderation Stats