M
Martin Horn
Hi all,
I wonder if someone can help me out with this problem.
I want to confine input of characters in a textbox to the amount that will
fit in a given width on printed output.
For example on the form that my program prints there is a space for text
that is 100mm wide, the string for which is provided by the customer by
entering it into a textbox prior to it being output to the printer.
How can I stop the user from entering more chars than will fit. Just setting
the maxlength property of the textbox isn't a very elegant solution as the
printed font isn't fixed width.
I assume I need to be able to check the length of the string as each char is
typed and decide whether it will fit or not and therefore decide whether
further input should be allowed or not.
As I can't figure out how to obtain the graphics object for the printer
without starting a print job I am stuck.
Can anyone provide a solution or at least point me in the right direction.
Many thanks,
Martin.
I wonder if someone can help me out with this problem.
I want to confine input of characters in a textbox to the amount that will
fit in a given width on printed output.
For example on the form that my program prints there is a space for text
that is 100mm wide, the string for which is provided by the customer by
entering it into a textbox prior to it being output to the printer.
How can I stop the user from entering more chars than will fit. Just setting
the maxlength property of the textbox isn't a very elegant solution as the
printed font isn't fixed width.
I assume I need to be able to check the length of the string as each char is
typed and decide whether it will fit or not and therefore decide whether
further input should be allowed or not.
As I can't figure out how to obtain the graphics object for the printer
without starting a print job I am stuck.
Can anyone provide a solution or at least point me in the right direction.
Many thanks,
Martin.