Solved

textbox- Scroll bars problem

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

776 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