Solved

Printing a ComboBox

Posted on 1998-10-19
3
390 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
ID: 1343356
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
ID: 1343357
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
ID: 1343358
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

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
Strange behavior when a form is closed 6 51
Delphi inherited method 6 63
FMX and jaudiotracker playing memory stream 29 66
Firemonkey android show image from resource ? 1 33
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 Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

895 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

16 Experts available now in Live!

Get 1:1 Help Now