|
Post by Alexander on Apr 7, 2004 8:17:08 GMT -5
this problem is really bugging me, neither me or AG can work it out... how can you have a disabled richtext box but still have the scrollbar enabled therefore preventing people editing / selecting / clicking the text but being able to view it?
|
|
|
Post by Cation on Apr 7, 2004 10:52:50 GMT -5
|
|
Tewl
xTeam
C# & VB Developer
Posts: 495
|
Post by Tewl on Apr 7, 2004 11:58:48 GMT -5
lock the control, set color to grey if u wantt he disabled look, then set the focus to something else when it is recieved
|
|
|
Post by Dangermouse on Apr 7, 2004 12:49:16 GMT -5
Public Sub switchRTB(ByRef rtb As RichTextBox) With rtb If .Locked = True Then .Locked = False .SelStart = 0 .SelLength = Len(.Text) .SelColor = &H0& .SelLength = 0 Else .Locked = True .SelStart = 0 .SelLength = Len(.Text) .SelColor = &H80000011 .SelLength = 0 End If End With End Sub
Will 'switch' the enable/disable look
|
|
|
Post by Alexander on Apr 7, 2004 13:22:44 GMT -5
yea unfortunatly u get flickering when someone tries to select stuff, i cant seem to prevent that
|
|
|
Post by Dangermouse on Apr 7, 2004 13:27:17 GMT -5
Well obviously because i assume you are deselecting text after they have already selected it, you will need to catch it before they highlight it and cancel it (api stuff)
|
|
|
Post by Alexander on Apr 7, 2004 13:31:03 GMT -5
yea, its kinda weird, i did think about using a vscroll on the rtfbox seperatly but theres no tuts on vscrolls at all
|
|
|
Post by Dangermouse on Apr 7, 2004 13:33:41 GMT -5
Set it to locked, and in the Click event, focus on another control (out of view) like kerry said, and de select, they cant select the text at all, and you can scroll.
edit : mouse/key down/up event too
best youre gonna get without api
|
|
|
Post by Webagent on Apr 7, 2004 13:55:58 GMT -5
.SetFocus on something else would do it yes, I have done it before, theres no way you can select something in the richtext thingy then, but you can scroll and read it.. I had no flickering.
Private Sub YourTXTthingy_KeyPress(KeyAscii As Integer)
sometingelse.SetFocus
End Sub
|
|