Solved

change font in grid

Posted on 2001-08-26
9
219 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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
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…

743 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

12 Experts available now in Live!

Get 1:1 Help Now