Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Printing a ComboBox

Posted on 1998-10-19
3
Medium Priority
?
399 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
ZifNab earned 300 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

721 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