Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Make editbox scrollbar disappear if not needed?
Message
From
16/04/2012 15:27:57
 
 
To
16/04/2012 13:21:28
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01541549
Message ID:
01541742
Views:
40
You are certainly correct.

However, in this instance, the editbox is readonly, so the problem which you identified does not occur.

>If I'm not mistaken, the scrollbar is displayed within the display area of the edit box -- which means that its visiblity would affect the display of the contents (i.e. its presence would implicitly make the display area "narrower" than without it). This would likely require two attempts to "re-flow" the text -- once with the assumption that there is no scrollbar, and another with the scrollbar if we determine that the text doesn't fit within the display area. This would have to occur with each keystroke within the edit box. Although probably not impossible to implement it would likely have an annoying behavior -- whenever you cross the "threshold" between point where scrollbar would appear/disappear, the forced "re-flow" of text would likely case the text to be arranged differently (i.e. the "soft" line breaks positions would shift around). The effect would be likely be most noticible with smaller display area -- which is likely the situation where you want to have this feature of appearing/disappearing scrollbar (to conserve "screen real-estate").
>
>>Koen --
>>
>>There are some good suggestions there to let me know how many lines there are
>>in an editbox, but that is not sufficient for my needs.
>>
>>I have not seen anything yet where it is possible to tell how many lines a given text
>>string will use in an editbox because of the line-wrap complication.
>>
>>For now, I am abandoning this and just leaving the scrollbar visible all the time. (sigh)
>>
>>
>>>James,
>>>
>>>take a look at the solution of Stuart : http://www.tek-tips.com/viewthread.cfm?qid=860687
>>>
>>>Regards,
>>>
>>>Koen
>>>++
>>>>Is it possible to have an editbox where the vertical scrollbar only appears if necessary?
>>>>
>>>>I believe I can compute how many lines will fit in an editbox, but know of no way in which I can
>>>>tell how many lines will be displayed because of the automatic line wrap.
>>>>
>>>>Two things I need to mention:
>>>>(1) This editbox is disabled, so I don't have to be concerned with what happens with user input.
>>>>(2) I can't use any other control instead, it must be an editbox.
>>>>
>>>>Thanks
Jim Nelson
Newbury Park, CA
Previous
Reply
Map
View

Click here to load this message in the networking platform