-
I have a textbox that needs scrollbars "sometimes", obviously when the text "won't" fit in the box. Hmmmm - Is there a way (Of course there is stupid, you just don't know), <throat clears>:-(, <dignified posture again>, to tell the application to only show the scrollbars when the text "won't" fit in the box?????
Sal
-
This probably isn't what your looking for, but I will give it a try anyway.
did you set the text box's multiline property to true?
then set the text box's scrollbar property
What this will do is "grey" out the scroll bar when all the text fits in the text box, but soon as there is more text than the text box can handle, the scroll bar becomes active.
hope this helps.
-
Naaa, your right, I'm looking for something else. They are greyed out, and then become active when the lines wrap past the last inch of space available. I would like to have them disappear until needed. Maybe it isn't possible.
Thanks anyway :eek:
Sal
-
If you have the windowless controls installed, the textbox.scrollbar property can be changed at runtime, that is if you can give up the .hwnd property for the textbox.
-
What is windowless control? :eek: ?
-
well you could hide ans show those scrollbars with iswindowvisible and showwindow api. You just need to get the hwnd of it
-
Could you dumb that down a little please...newbie here. Or, maybe give me an example so I can look it up in my reference library.
Thanks,
Sal
-
Visible/invisible Wnd's
Well, here's how to make visible/invisible but wait further, i will get to the scrollbars later
Code:
Private Declare Function IsWindowVisible Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Property Get visiblewnd(hwnd As Long) As Boolean
clockvisible = IsWindowVisible(hwnd)
End Property
Property Let visiblewnd(hwnd As Long, newvalue As Boolean)
ShowWindow hwnd, newvalue * -5
End Property