 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Alex Guest
|
Posted: Wed Dec 10, 2003 10:36 pm Post subject: Font changing problem |
|
|
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
|
Posted: Wed Dec 10, 2003 10:49 pm Post subject: Re: Font changing problem |
|
|
"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 |
|
 |
|
|
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
|
|