Solved

textbox- Scroll bars problem

Posted on 2002-04-11
4
303 Views
Last Modified: 2012-05-04
HI,
I have a textbox,
I have set its properties as
Multiline to true
Scrollbars to both
locked to true

i have locked it because i dont want its contents to be edited.
the problem now is, when i display big messages, its scrollbars are not enabled. i want its scroll bars enabled and still lock the contents. i dont want the textbox to be disabled.
0
Comment
Question by:RanjiniPraba
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 22

Expert Comment

by:rspahitz
ID: 6934959
You can always try this code:

Private Sub Text1_KeyPress(KeyAscii As Integer)
  KeyAscii = 0
End Sub

This won't stop people from pasting with the mouse or menu, but will at least stop keyboard input.  That should cover most cases.
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 6934962
unlock it and in the keydown event set the keycode argument to 0.
0
 
LVL 18

Accepted Solution

by:
mdougan earned 15 total points
ID: 6934986
One final thing.  If you have a multi-line textbox, you really shouldn't have a horizontal scrollbar.  I haven't tried it lately, but it used to be that you couldn't get the text to wrap if you had a horizontal scrollbar.

Without a horizontal scrollbar (but with a vertical one) then text will automatically wrap around if multi-line is set to true.
0
 
LVL 20

Expert Comment

by:hes
ID: 6935063
I tried this
Textbox Text1
Multiline to true
Scrollbars to both
locked to true


Dim t As String
t = Clipboard.GetText

Text1.Text = t

Copied this entire Question to the clipboard and ran teh program.
Both scrollbars worked just fine
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question