Solved

change font in grid

Posted on 2001-08-26
9
229 Views
Last Modified: 2013-12-03
How can I change font style for my rxdbgrid using that font component?
0
Comment
Question by:Enej
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
9 Comments
 
LVL 6

Expert Comment

by:DrDelphi
ID: 6428864
 Fontdialog1.Execute;
  With FontDialog1 do
  begin
    Rxgrid1.Font.Name:=Font.Name;
    Rxgrid1.Font.Size:=font.size;
    Rxgrid1.Font.Color:=font.Color;
    RxGrid1.font.Style:=font.Style;
    (*Etc,etc,etc*)
  end;


Good luck!!
0
 

Author Comment

by:Enej
ID: 6429347
What I had in mind is that FontComboBox that comes with RX tools....I tried above sugg. and it only changes once!?
I want the font to change through fontcombo and not the popup classic dialog to come up.
When I select a font in that combo I want the font to change automatic without popup dialog...
0
 

Author Comment

by:Enej
ID: 6429401
I use that fontcombo.How do you change wit that thing?I do not want font dlg. to appear...
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 6

Expert Comment

by:DrDelphi
ID: 6429502
Well, I can't help you with the Rx component, but if all you want is to change the current font, you could just as easily do this:

procedure TForm1.FormCreate(Sender: TObject);
begin
  combobox1.items:=Screen.fonts;
end;

procedure TForm1.ComboBox1Change(Sender: TObject);
begin
  dbgrid1.font.name:=Combobox1.Items[Combobox1.itemindex];

end;





Good luck!!
0
 
LVL 5

Accepted Solution

by:
alanwhincup earned 50 total points
ID: 6429505
Here you are:

procedure TForm1.FormCreate(Sender: TObject);
begin
  //Change Font ComboBox selection to the Grid's current font.
  FontComboBox1.FontName := RxGrid1.Font.Name;
end;

procedure TForm1.FontComboBox1Change(Sender: TObject);
begin
  //Change Grids current font to whatever is chosen on FontComboBox.
  RxGrid1.Font.Name := FontComboBox1.FontName;
end;

Cheers,

Alan
0
 
LVL 6

Expert Comment

by:DrDelphi
ID: 6429532
Alan,
  Did that actually work for you? I tried with version 2.75 of the RXlib and it didn't.

0
 

Author Comment

by:Enej
ID: 6429677
This is OK !T
0
 
LVL 5

Expert Comment

by:alanwhincup
ID: 6429750
DrDelphi,
  I have the same version and it appears to work...
0
 
LVL 6

Expert Comment

by:DrDelphi
ID: 6429849
Hmmmm.... weird! I'm going to have to look into this.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses
Course of the Month4 days, 13 hours left to enroll

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question