BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Re: Captions disappearing from ToolButtons

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi VCL Components Using
View previous topic :: View next topic  
Author Message
Russell Jesson
Guest





PostPosted: Fri Jul 25, 2003 8:36 am    Post subject: Re: Captions disappearing from ToolButtons Reply with quote



Stephen

Many thanks fro your response I'll investiagte your suggestions.

I create a set of 20 buttons as the pgn starts up. These are referenced from
20 objects as a property, see the code below. Then simply as a condition
changes on the STV object it updates the caption of the associated button.

for i := 0 to (C_NB_STV_AVAIL - 1) do
begin
Stv := TStv.Create;
Stv.Number := i + 1;
Stv.Index := i;
Stv.Alarm := False;
Stv.OnArriveZone := StvArrivedZone;
Stv.OnLeaveZone := StvLeftZone;

{ Start to build the Toolbar }
Stv.Button := TToolButton.Create(frmMain);
with Stv.Button do
begin
Parent := ToolBar1;
DropdownMenu := popstv;
Tag := i;
ImageIndex := 1;
Caption := IntToStr(i + 1);
SetBounds(Left,Top,64,64);
OnMouseDown := WhichButtonClicked;
end;
Stvs.Add(Stv);
end;



"Stephen R. Phillips" <cyberman (AT) socket (DOT) net> wrote

Quote:
"Russell Jesson" <r_jesson (AT) yahoo (DOT) com> wrote in
news:3f1fdbb3$1 (AT) newsgroups (DOT) borland.com:

Hallo

Using D6 I have a toolbar with a series of buttons with captions.
These captions are occasionally updated to reflect changes in the
application which relate to the toolbutton.

However every now and then the captions go blank, the buttons remain
the same size but the caption text has disappeared. Now desptite
refreshing the property the captions will not reurn untill to re-start
the application.

Anybody have any ideas

Many Thanks

Russell Jesson




Are the toolbottons generated on the fly or are they set from a resource?
I
assume the latter. If I could hazard a guess, check the available
resources if you are low on system resources it might be that you have
been
allocating resources without releasing them and.. well it's a no no.
That's
the only thing I can think of at this time. If not someone with greater
wisdom and more experience likely will be able to help, I would like to
know what the solution is (in case I run into it).

You could experiment by using the delete function on the caption text

---------------
Delete(<object>.Caption, 1, 256);
Object.Caption := <new text>;
---------------

Are you creating new objects each time you are assigning text to them? how
are you assigning text?

Stephen



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi VCL Components Using All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.