|
Author |
Message |
Rv! #1 / 6
|
 Scroll bars when needed?
Hi How do I get VB6sp5 to display scrollbars on Textboxes (etc) only when needed? If I switch them on they're on whether needed or not. Is there a simple way to detect that the text is no longer fitting the box, and swtich them on as needed myself? Hmmm. A simple, but annoying problem. Rv!
|
Sat, 30 Jul 2005 23:07:32 GMT |
|
 |
Akai #2 / 6
|
 Scroll bars when needed?
Hi, Use a rich textbox. The normal one doesn't support this capability (not that I know) Regards, Akai
Quote: > Hi > How do I get VB6sp5 to display scrollbars on Textboxes (etc) > only when needed? If I switch them on they're on whether needed > or not. Is there a simple way to detect that the text is no longer fitting > the box, and swtich them on as needed myself? > Hmmm. > A simple, but annoying problem. > Rv!
|
Sun, 31 Jul 2005 04:37:05 GMT |
|
 |
Rv! #3 / 6
|
 Scroll bars when needed?
Hi, I've never really used RTBoxes as I always wondered if there's an overhead with speed etc (Not that it should really be a problem.) I played with one the other day and found it a PITA getting colour information loaded etc. I will have another look again and see the results. Thanks for your info. Robert
| Hi, | | Use a rich textbox. | The normal one doesn't support this capability (not that I know) | | Regards, | Akai |
| > Hi | > | > How do I get VB6sp5 to display scrollbars on Textboxes (etc) | > only when needed? If I switch them on they're on whether needed | > or not. Is there a simple way to detect that the text is no longer fitting | > the box, and swtich them on as needed myself? | > | > Hmmm. | > | > A simple, but annoying problem. | > Rv! | > | > | |
|
Sun, 31 Jul 2005 17:00:34 GMT |
|
 |
J Fren #4 / 6
|
 Scroll bars when needed?
Option Explicit Private Const SB_VERT = 1 Private Const SB_BOTH = 3 Private Const SB_HORZ = 0 Private Declare Function ShowScrollBar _ Lib "user32" _ (ByVal hwnd As Long, _ ByVal wBar As Long, _ ByVal bShow As Long) As Long Private Sub Command1_Click() Static Flag As Boolean, Q& Q = 0 Flag = Not Flag If Flag Then Q = 1 Call ShowScrollBar(Text1.hwnd, SB_BOTH, Q) End Sub Quote:
>Hi >How do I get VB6sp5 to display scrollbars on Textboxes (etc) >only when needed? If I switch them on they're on whether needed >or not. Is there a simple way to detect that the text is no longer fitting >the box, and swtich them on as needed myself? >Hmmm. >A simple, but annoying problem. >Rv!
|
Sun, 31 Jul 2005 18:40:52 GMT |
|
 |
Rv! #5 / 6
|
 Scroll bars when needed?
I hadn't realised, or really looked into, the scrollbars only being read only at runtime. I thought I would just be able to just switch them on so thanks for that information. Also found it in the APIGuide on looking. I still see no way of detecting the need for scrollbars other than to estimate/measure the lines used in code, but that would be a pain if the box size was changed. As another poster mentioned, I will look into using an RTB as they seem to support this type of operation. Rv!
|
Sun, 31 Jul 2005 19:55:06 GMT |
|
 |
J Fren #6 / 6
|
 Scroll bars when needed?
Quote:
>I hadn't realised, or really looked into, the scrollbars only being read >only at runtime. I thought I would just be able to just switch them on >so thanks for that information. Also found it in the APIGuide on looking.
The one from www.AllAPI.net - very useful resource Quote: >I still see no way of detecting the need for scrollbars other than to >estimate/measure the lines used in code, but that would be a pain if >the box size was changed.
Look at SendMessage - EM_GETLINECOUNT Quote: >As another poster mentioned, I will look into using an RTB as they seem >to support this type of operation.
Yes, but the problem with that is that it is just one more dodgy OCX to distribute Quote:
|
Sun, 31 Jul 2005 20:16:39 GMT |
|
|
|