I know that I can determine the length of a line as in sngLineLnth = Printer.TextWidth(Text1.Text). Because I have a limited printed space, say 5 inches, I want to control (?) the input length to prevent losing the end of a line too long (like this sentence). My idea is: I set the printed font size, say Arial 10, and as the user types the statement in a text box, a window/form continuously displays the line length in inches and warns the user when the line length exceeds 5 inches. I have done something similar to this using a command button, but that is a type and click method. (Kind of crude method.)
Is it possible to indicate the length of a typed line (automatically update) as the user enters it in the text box with no user action other than typing the message? If yes, how do I do it?
"Jim Y" <j.s.yablon...@NOSPAMatt.net> wrote in message <news:xldsc.21191$fF3.542434@bgtnsc05-news.ops.worldnet.att.net>... > I know that I can determine the length of a line as in sngLineLnth = Printer.TextWidth(Text1.Text). > Because I have a limited printed space, say 5 inches, I want to control (?) the input length to > prevent losing the end of a line too long (like this sentence). My idea is: I set the printed font > size, say Arial 10, and as the user types the statement in a text box, a window/form continuously > displays the line length in inches and warns the user when the line length exceeds 5 inches. I have > done something similar to this using a command button, but that is a type and click method. (Kind > of crude method.)
> Is it possible to indicate the length of a typed line (automatically update) as the user enters it > in the text box with no user action other than typing the message? If yes, how do I do it?
Use Text1_Change?
-- Joe Foster <mailto:jlfoster%40znet.com> "Regged" again? <http://www.xenu.net/> WARNING: I cannot be held responsible for the above They're coming to because my cats have apparently learned to type. take me away, ha ha!
<j.s.yablon...@NOSPAMatt.net> wrote: >I know that I can determine the length of a line as in sngLineLnth = Printer.TextWidth(Text1.Text). >Because I have a limited printed space, say 5 inches, I want to control (?) the input length to >prevent losing the end of a line too long (like this sentence). My idea is: I set the printed font >size, say Arial 10, and as the user types the statement in a text box, a window/form continuously >displays the line length in inches and warns the user when the line length exceeds 5 inches. I have >done something similar to this using a command button, but that is a type and click method. (Kind >of crude method.)
>Is it possible to indicate the length of a typed line (automatically update) as the user enters it >in the text box with no user action other than typing the message? If yes, how do I do it?
Simply calc and display in the Textbox's Changed event
It does the job. I appreciate the help. Thanks to both of you. I truly appreciate this newsgroup. I have received answers to all of my questions, something the texts that I purchased have not been able to do.
Thank you, Jim Y
"Jim Y" <j.s.yablon...@NOSPAMatt.net> wrote in message
> Because I have a limited printed space, say 5 inches, I want to control (?) the input length to > prevent losing the end of a line too long (like this sentence). My idea is: I set the printed font > size, say Arial 10, and as the user types the statement in a text box, a window/form continuously > displays the line length in inches and warns the user when the line length exceeds 5 inches. I have > done something similar to this using a command button, but that is a type and click method. (Kind > of crude method.)
> Is it possible to indicate the length of a typed line (automatically update) as the user enters it > in the text box with no user action other than typing the message? If yes, how do I do it?
Jim Y wrote: > I know that I can determine the length of a line as in sngLineLnth = Printer.TextWidth(Text1.Text). > Because I have a limited printed space, say 5 inches, I want to control (?) the input length to > prevent losing the end of a line too long (like this sentence). My idea is: I set the printed font > size, say Arial 10, and as the user types the statement in a text box, a window/form continuously > displays the line length in inches and warns the user when the line length exceeds 5 inches. I have > done something similar to this using a command button, but that is a type and click method. (Kind > of crude method.)
> Is it possible to indicate the length of a typed line (automatically update) as the user enters it > in the text box with no user action other than typing the message? If yes, how do I do it?
> Thank you, > Jim Y
Yup, just put your code in the Text1_Change() event.