Solved

textbox- Scroll bars problem

Posted on 2002-04-11
4
302 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
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

856 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