Solved

change font in grid

Posted on 2001-08-26
9
221 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Intraweb download file link ? 1 110
Reconfigure Delphi Install? 2 46
Base1 Encode/Decode 3 68
Moving (cutting/pasting) controls in a TTabbedNotebook... 7 27
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
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…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

862 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now