Solved

Printing a ComboBox

Posted on 1998-10-19
3
388 Views
Last Modified: 2010-04-06
I have tried useing the Print() function to print a form,
but why it not prints the text of the ComboBox? (Delphi 3)
0
Comment
Question by:MikeWang
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
ZifNab earned 100 total points
Comment Utility
Hi MikeWang,

I believe it has to do with the reaction of the TCombobox with the WM_Paint message...

use this article for printing your form :

http://www.inprise.com/devsupport/delphi/ti_list/TI3155.html

Regards, Zif.
0
 
LVL 10

Expert Comment

by:viktornet
Comment Utility
Hello MikeWang!

Why not try this one :-)

var
  F : TextFile;
begin
  AssignPrn(F);
  try
    Rewrite(F);
    Printer.Canvas.Font.Assign(ComboBox1.Font);
    WriteLn(F, ComboBox1.Text);
  finally
    CloseFile(F);
  end;
end;

Haven't tested this one, but if it works please don't forget the credit ;->

Cheers,
Viktor
0
 
LVL 8

Expert Comment

by:ZifNab
Comment Utility
Viktor,

 Isn't this for only printing the combobox text? I don't think that this is what MikeWang wants.

 MikeWang uses the Print property of the form. Thus he wants to print the whole form. This print property then doesn't print the combobox text... To get the whole form printed + the selected text in the combobox, you better use the method presented in the Inprise Example.

Regards, Zif.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

772 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

13 Experts available now in Live!

Get 1:1 Help Now