Solved

change font in grid

Posted on 2001-08-26
9
224 Views
Last Modified: 2013-12-03
How can I change font style for my rxdbgrid using that font component?
0
Comment
Question by:Enej
  • 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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
control image tags in a string ? 12 142
Need Help Delphi 2010 CheckBox1 Stored value in memo 13 72
Dynamically Created Query 3 62
Firemonkey allowing RTL on android 6 47
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

830 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