Board index » delphi » Printing and combobox problems !!!

Printing and combobox problems !!!

Hi !!!

Im kinda new at this so.......

1. Well, I would like to know how to set the printing margins on  all
sides so that
when I print a text from a richtextedit it looks better than it does
right now.....
Is that possible ?

2. I have set the fontname and fontsize in comboboxes but when I chose
anything
from them the selection marking (the black thing u know) disappears....
The selection is there but it doesnt show......
Can I make it show all the time til the font is changed ?

3. How do I update the cursorposition when I am to chose a font for a
selection?
Either all the text changes or there occurs a bug that the first lines
changes font.....
This appears when I write something in the richedit and without
selecting text I change
to another font that I am to continue with......

I know that this prob is too much to ask but at least I'll make a
try.....

Thank you all for previous answers!!!!  :)

 

Re:Printing and combobox problems !!!


Weilo,

there is a fairly complete demo application for the rich edit control that
comes with Delphi, it shows examples for the things you ask about.

1. Printer margins:

  trichedit.PageRect lets you set the printing area. Contrary to the docs
  the units to use are not twips but pixels, the same units used by  
Printer.Pagewidth and Printer.PageHeight, which give you the dimensions
  of the printable area in pixels or dots (lets use pel = Picture ELement  
  as a device-neutral name).
  GetDeviceCaps( Printer.handle, LOGPIXELSY ) gives you the number of pels
  per inch, so you can calculate how many pels make up a 0.75 inch border,
  for example.

2. Selection
  Set the controls HideSelection property to False to keep the selection
  visible when the control looses focus.

  Assign font properties to the richedits SelAttributes property to have
  them apply to the current selection. You set the selection in code using
  the SelStart and SelLength properties.

Peter Below (TeamB)  100113.1...@compuserve.com)

Other Threads