Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is it possible to display text without word wrap?
Message
From
03/12/1998 12:01:00
 
 
To
03/12/1998 11:54:10
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00151158
Message ID:
00163689
Views:
29
>>>>>>>>>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?
>>
>>As I said, it was not serious solution, but it can work somehow. For example, look at this code:
>>*** vertical scroll (slider) click event
>>Thisform.MyTimer.Enabled=.T.
>>*** mytimer.timer event: timerstep=0 initially
>
>>WITH thisform.edit1
>> DO CASE
>> CASE thisform.Timerstep=0
>> thisform.lockscreen=.t.
>> thisform.Timerstep=1
>> .left=0
>> .zorder(0)
>> CASE thisform.Timerstep=1
>> thisform.Timerstep=2
>> MOUSE click
>> CASE thisform.Timerstep=2
>> thisform.Timerstep=0
>> .left=200
>> this.enabled=.f.
>> thisform.command2.zorder(0)
>> thisform.lockscreen=.f.
>> ENDCASE
>>ENDWITH
>
>> MOUSE click
>
>I must add at clause to mouse click statement to click editbox
>vertical scrollbar scroll button, am I right?
>
>> .left=0
>
>instead of this I must use
>
>.left = - .width + thisform.width
>
>to place editbox scrollbar into screen. Otherwise it is not possible to scroll it?

No, the idea is that you move editbox' scrollbar to the same place as your own-made scrollbar and click to the same point.

>Why there aren't a method to scroll editbox programmatically?

Probably, because it's really rare requirement, you try to fight.
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform