How come in Windows NotePad, when you click "Word Wrap" off,
it adds a horizontal scroll bar, but when I tried to emulate that, it has an error saying that I can't change a read-only property(i.e. - scrollbar orientation)?
How would I do that then?
Printable View
How come in Windows NotePad, when you click "Word Wrap" off,
it adds a horizontal scroll bar, but when I tried to emulate that, it has an error saying that I can't change a read-only property(i.e. - scrollbar orientation)?
How would I do that then?
I'm not really sure what yuo mean but I think this would help... :
Code:Text1.Scrollbars = x
'Replace x with one of the following:
'0 = None
'1 = Horizontal
'2 = Vertical
'3 = Both
You can add or change scrollbars and properties at design time only.
so how does NotePad do it??
What about having two textboxes.
That you assign one textbox the wrap thing but not to the other one.
Now every time the user switches you assing the other textbox the text of the one that was active. than you make one of them invisible. (I know it isn't perfect, but it will work, you can clear the one of those box that isn't active, to save memory)
I was thinking about that, I guess that's how its going to have to be.
tell me if it worked out fine when you are done.
If you use toolz like spy++ and spy notepad, you'll see that it uses two edit-ctrls, cause there are two different hwnds!
/\/\isanThr0p: HA! MAL N DEUTSCHER BEI VBWORLD...
Hehe ich habe im Ganzen forum nur 4 deutsche Ausmachen keonnen, von denen einer aus der Schweiz ist lol!
Sorry ppl! I couldn't resist! I'm really wondering why microsoft didn't just code a new textbox, instead of just giving a real simple thing that wastes memory! I don't think it cares a lot, but if they do it with all their stuff like this...
I'm here to prove you wrong Wayne :rolleyes:.Quote:
Originally posted by HeSaidJoe
You can add or change scrollbars and properties at design time only.
Scrollbars can be hidden or shown during runtime.
Code:Private Declare Function ShowScrollBar Lib "user32" _
(ByVal hwnd As Long, ByVal wBar As Long, _
ByVal bShow As Long) As Long
Private Const SB_BOTH = 3
Private Const SB_HORZ = 0
Private Const SB_VERT = 1
Private Sub Command1_Click()
ShowScrollBar Text1.hwnd, 3, False
End Sub
Private Sub Command2_Click()
ShowScrollBar Text1.hwnd, 3, True
End Sub