Scroll bars when needed? 
Author Message
 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  
 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  
 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  
 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  
 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  
 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:

>Rv!



Sun, 31 Jul 2005 20:16:39 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Text Box and Scroll Bars - Help Needed...

2. MSFlexgrid scroll bar, help needed

3. Flakey scroll bars (Guru needed)

4. Building A Scroll Bar / Scroll Bar Colors

5. Need bar to stop screen scrolling

6. Need a List Box with a Horizontal Scroll Bar

7. Need Help On Scroll Bar

8. Need help please - Scroll Bar causing Out of Memory error

9. Picture Box (scroll bars needed)

10. Help Needed : using scroll bar to move an image on a picture box

11. HELP:Need scroll bars on a form CSFORM16.OCX does not work

12. Need Scroll Bar That Uses LONG integers

 

 
Powered by phpBB® Forum Software