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 

Font changing problem

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.misc
View previous topic :: View next topic  
Author Message
Alex
Guest





PostPosted: Wed Dec 10, 2003 10:36 pm    Post subject: Font changing problem Reply with quote



I have a simple bit of code on one form:

procedure TForm2.FormCreate(Sender: TObject);
begin
ComboBox1.Items := Screen.Fonts;
end;


procedure TForm2.Button1Click(Sender: TObject);
var
font:string;
begin
Font:=ComboBox1.text;
form1.Label3.Font.name:=Font;
end;

Now the problem with this is that sometimes it works, and then other times
it wont work at all, which to me doesn't make much sense. The first time i
open the program and change this, it will work. But then if i select
another font and change it, it will go back to the default font it was on
to start with.
Back to top
Bruce Roberts
Guest





PostPosted: Wed Dec 10, 2003 10:49 pm    Post subject: Re: Font changing problem Reply with quote




"Alex" <s.ecrettipoff (AT) hotmail (DOT) com> wrote


Quote:
Now the problem with this is that sometimes it works, and then other times
it wont work at all, which to me doesn't make much sense. The first time i
open the program and change this, it will work. But then if i select
another font and change it, it will go back to the default font it was on
to start with.

I had no problems with the code you posted, (actually I simplified
Button1Click to Label1.Font.Name := ComboBox1.Text.), but as you may have
deduced, I simply placed the label on the same form. I would suspect that
the problem is not with the code you posted. Much more likely its caused by
either the Form1 reference changing, or code in the tForm1 onShow or
onActivate event. Possibly it has to do with how you are managing Form2.



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.misc 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.