textbox-problem...

Mulder
09-04-2003, 05:54 AM
Hello everybody,

i have to create an application to do wordpressecing. Normally simple! But here's my problem:
I have a multiline textbox with 30 visible textlines. If i am at the bottom of the textbox (in line 30) and if i press enter or a word-wrap changes to the next line (here line 31) the textbox should do something like a paging:
Now the textbox should look like emty and the cursor should be set at the visible line one (but here it is line 31 of the whole text).
The text should be stored in one textbox and it should seems like it is a new page...!

I've worked on that problem for the last 4 weeks and i can't fine a solution.

susanl
09-04-2003, 06:17 AM
You can't "paginate" a textbox in that way and I doubt if you could even do it with a RichTextBox, though you could try. The only solution I can see is to add an OLE object to your form and set it to a WordPad document, or MS Word if the WordPad setting isn't available. Help on working with OLE objects should be on MSDN somewhere!

Deadalus
09-04-2003, 07:09 AM
Detecting when there are 30 visible lines is rather easy, with SendMessage and EM_GETLINE and EM_GETFIRSTVISIBLELINE. However, I'm not sure if you can show a white page without actually adding 30 line breaks, which probably is not what you want.

bk2003
09-04-2003, 07:49 AM
Have you considered to put the 'old' textbox in a varable (array) and
then clear the text box. This way you will get a 'new' page.
You will have to program the paging function, so it restores the right
variable back to the textbox.

This may be a solution. (Not sure how to do it)

/BK

bk2003
09-05-2003, 05:04 PM
Have you considered to put the 'old' textbox in a varable (array) and
then clear the text box. This way you will get a 'new' page.
You will have to program the paging function, so it restores the right
variable back to the textbox.

This may be a solution. (Not sure how to do it)

/BK



I was 'forced' to try this of my own. I got this part with the Array thing working, but there is a big problem to get the paging at the right line.

Anyway, I have attached my sample here...

/BK

Mulder
09-09-2003, 02:22 AM
Thank you bk,
your example is good. And i know the problem with the lines.
I try to set the focus on the first line of the next page and scroll to that position.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum