Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exceeding Excel VBA userform textbox limit 1

Status
Not open for further replies.

automaker

Technical User
Aug 21, 2007
64
US
I have an application for other users. I want to make an introduction of sorts available for new users. I created a userform with a textbox that contains the lengthy introduction. I understand there is a limit to how much text can be put in the textbox? Is that correct? Is the limit the usual 255 characters? If so, how do I get around it? What would be a good way to provide the user with this information?

Thanks for the help.

Mark
 
Hi,

Generally...

Textboxes are for users to enter stuff--responces.

Lables are for information.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Thanks to both. I think I actually knew that I should use a label. I think I opted for a text box because I had more text than would fit in the space I had for the control and I could add a scrollbar to the text box and not to the label.

I basically have an application that when launched, starts with a user form containing a couple of different command buttons. One button is for an introduction which explains the application and what the user needs to do. My intent was to have a user form open that contained a text box/label displaying the information and a close button.

So here is where I am. A label doesn't seem to allow me to have a scroll bar and the text box doesn't want to let me put a lot of text in it.

Am I just barking up the wrong tree here?

Thanks,
Mark
 



You can use a scroll control with a label and a variable or constant that contains the entire text. Just assign a substring of the text to the lable, using the Mid function, based on the position of the scroll control and the length you want to display in the Label. When the user changes the scroll, assign the appropriate substring.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Skip,
I see, I see said the blind man. I may give that a try as I have never done that before.

I am currently working on assigning the entire text to a string variable and then assigning the string variable to the textbox value. Since the scrollbar is part of the textbox control, this may be a little easier to implement. The textbox seems to be able to handle more characters this way.

Thanks for all the help.

Mark
 
I was trying assign a label characters from a textstream object file based on the value of a scrollbar control.

I gave up before getting anything to work, but I'm reasonably sure it could be done.
 
Since the scrollbar is part of the textbox control..."

What about the SCROLLBAR control?



Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
The simple way to have scrollable text is to add frame and insert a longer label with text onto it. Next adjust frame: no caption, vertical scroll bar and ScrollHeight higher than label's height. You can change SpecialEffect too.

combo
 
Skip,
Maybe I wasn't clear or maybe it is the version of software that is causing some confusion.

I am using Excel 2002 with VBA 6.3

In this version, a textbox control has a scrollbar property. It can be set to none, vertical, horizontal, or both. The label control does not have a scrollbar associated with it. At least I can't find one. That is why I am thinking that using the textbox control may be easier to implement. I won't have to deal with two controls (label and scrollbar).

I was able to find time to give the idea of assigning the required text to a string variable and then assigning that variable to the textbox value property. It seems to work fine.

Thanks to all for the help.

Mark
 
You were perfectly clear. Yes, I know that the textbox control has a scrollbar. Yes, I know that the label control does not.

I am suggesting using the SCROLLBAR control, independent of ANY OTHER control, in conjunction with the Label control and the Mid function. It will take you some work, since it is not integrated with that control.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Given that the OP requires behaviour that neither the textbox nor a label controls provide natively by default, I'm not sure why using a listbox with extra code and controls is seen as a necessarily better solution to setting a textbox's multiline and locked properties to true
 
strongm,
I'm not sure that a label with extra code is necessarily better, but it is another option. Also, as Skip has said,
Textboxes are for users to enter stuff--responses.

Lables are for information.

Thanks,
Mark
 
>Textboxes are for users to enter stuff--responses.
>
>Lables are for information.

Unfortunately this is misleading info. Whilst a label is indeed for displaying information (although typically only relatively short bits of info), a texbox (edit control) has multiple uses, which include: entering, displaying, and editing "small" amounts of text

Allow me to point you to the Text Box Usage Patterns section of the Windows Vista User Experience Guidelines (the current incarnation of the authoratative Microsoft Windows User Experience: Official Guidelines for User Interface Developers and Designers) which very specifically describes using a textbox in exactly the way the OP requires
 
strongm,
Thanks for the info and the link. I appreciate the help.

Mark
 
Good stuff, Strongm! ==> *

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top