Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is it possible to display text without word wrap?
Message
De
01/12/1998 14:28:47
 
 
À
28/10/1998 15:35:59
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00151158
Message ID:
00162899
Vues:
33
>>>>>>I want to display text-only report in form, without word wrap
>>>>>>and with horizontal scrollbar.
>>>>>>
>>>>>>I placed an editbox control into form. However, this control wraps lines
>>>>>>horizontally always and does not have horizontal scroll bar.
>>>>>>
>>>>>>Is it possible to display text file without word wrap in form ?
>>>>>
>>>>>I had an editbox once that I didn't make high enough to show two lines of text and it didn't wrap it. But that may be a case of the cure is worse than the problem...
>>>>
>>>>Maybe to make editbox wider than form and emulate scrolling
>>>>in some way?
>>>
>>>There is one comic solution:
>>>1. You really make editbox wider, much wider then form, wide enough to exclude wrapping, Editbox.Left=0 (initially).
>>>2. This editbox will overlay grid except the lower part of it, i.e. horizontal scrollbar.
>>>3. Grid.Scrolled event will be used to change Editbox.Left property, so you will move Editbox.Left to negative area while scrolling to right.
>>>4. It probably necessary here to have Timer evaluating current text insertion point to move editbox too.
>>
>>Edward, can you provide some sample code how to implement this?
>>I need only report previewing so it may be a read-only editbox
>>without timer?
>
>Sorry, but I had no time to write any code writing that reply :), but it seems to work Ok. BTW, probably I was wrong about timer: you don't need in it. Instead, you will check for arrow keys in Editbox.Keypress event. Surely, you should experiment with grid content to correlate it with actual editbox width.

Edward, thank you for this solution.
I tried to emulate text file viewing with grid control, but
it was difficult to implement horizontal scrolling. Also, line length
was limited to 254 chars and a strange underline shadowing appears
in current line even when I turned all grid highlights off.

Today I switched to your solution. This seems to work more
reasonably.
However, I was unable to use mouse with this method: since editbox is
wider than form, it is impossible to use its native scroll bar.
I must use some slider style control to emulate scroll bars.
Is it possible to cause editbox control to do vertical scrolling
programmatically?

Also, it seems to be difficult to implement horisontal scroll
bar using grid scroll bar. I must also replace this with
handmade scrollbar control. Which is the best way to implement
such controls?
Andrus
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform