Can anyone help me with Scrollbars please?

  • Thread starter Thread starter kirkm
  • Start date Start date
K

kirkm

Thanks. I want a verticle scrollbar on a label.
That may not be allowed.... but if it goes on the Form,
how it is controlled?

Thanks - Kirk
 
You can't add scrollbars to a label; however, if I understand why you are
asking this question correctly, you can use a TextBox and set its Lock
property to True to prevent users from being able to change the text in it.

Rick
 
You can't add scrollbars to a label; however, if I understand why you are
asking this question correctly, you can use a TextBox and set its Lock
property to True to prevent users from being able to change the text in it.

Hi Rick, that's almost got everything I was after. Except the one
thing that stuffs it up. How do I turn the cursor off? Or make it
the same background colour as the textbox would do. I'm using
SelStart = 0 to force the first line, but the flashing cursor spoils
the apperance. I think this was why I moved to a label. Hmmm..
any thought?

Thanks - Kirk
 
Another idea, put an ordinary Label in a Frame.
Give the frame a vertical scrollbar and size the frame to suit. Optionally
remove the Frame's caption, set Frame's BorderStyle=1, remove the Label's
border.

Manually or at run time set the ScrollHeight to Label's height (or tweak as
required).

Regards,
Peter T

PS, ensure the Label really is IN the Frame and not merely over it.
 
I am sorry, but I don't think I can help you with this. My suggestion was
based on things I know how to do with a TextBox over in the compiled world
of VB; however, it looks like the TextBoxes over there are completely
different that those you can use here in Excel. For example, the way I would
handle what you have just asked over in the compiled VB world is to
immediately set focus to another control whenever the TextBox got focus.
Doing that would mean the cursor would never appear in it. Doing this would
still allow the TextBox's scroll bar to work because touching that does not
give focus to the TextBox itself. However, it seems that whenever you touch
the scroll bar for an Excel TextBox, the TextBox itself gets focus
immediately... so the trick won't work in here.

Rick
 
I've just pondered this one.

My easy but dirty hack, a dummy textbox of size 0x0 anywhere.. ..then
..Activate it to send the annoying cursor elsewhere.

Anybody know how to highlight all the text AND set the first line in focus?
...I suppose I could just do the colour inverting myself...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top