Windows - Disable TextArea Scrollbars

I assume this is a Declares item… user32?

When scrollbar horizontal is off then wordwrap is enabled.

When scrollbar vertical is off, then no scroll period.

I can’t find the right constant in the windows docs though.

  1. disable wordwrap when scrollbar is off
  2. disable live scroll when typing
  3. disable scrollbars

You really need no word wrap and no scroll bar?


I may be able to help with new plugin method to change configuration…

@Michel Bujardet awesome, I see what you did - one of the biggest things was scrolling, and you just provided me the right path to work around the issue.

still sucks I have to embed though - if this is really a platform specific problem, would it be more wise of me to seek out a platform specific solution like a declare into the winapi?

@Christian Schmitz

I actually think this is basic functionality?

  1. While typing - with scrollbars active, live scroll is automatically set, with no way to turn it off.
  2. the only way to rid the scrollbars is to embed, for example, in a canvas and extend the text area… requiring a whole other item.
  3. if you just want no scrollbars, and your text goes vertically offscreen - you can’t code a scroll position at all…
  4. if you disable a horizontal bar, then wordwrap is automatic.

the reason I went off on declares is because there is a value to set-margin, and font, and text properties… just seemed like the right method to handle such an oddity

Funny, the code below does not works:

Function KeyDown(Key As String) Handles KeyDown as Boolean Me.HasHorizontalScrollbar = False Me.HasVerticalScrollbar = False End Function

Note to Robert: if you do not type more characters horizontally and less lines than the TextArea can hold, no ScrollBar will appears.

Now, Christian question is valid and do not had an answer.

Remember that visible ScrollBar (hiden by Preferences on macOS) allows the user to know there are invisible data (data out of the Control visible boundaries).

I am really curious to know why.

If interested, I can check in the next days and maybe add a new property there via plugin.

We added WinAutoHorizontalScrollMBS and WinAutoVerticalScrollMBS to TextArea control for next MBS Plugin prerelease.

[code]Declare Function GetDC Lib “User32.dll” Alias “GetDC” (hWnd As Integer) As Integer
Dim dc As Integer = GetDC(textarea1.Handle)

Declare Function SendMessage Lib “User32.dll” Alias “SendMessageW” (hWnd As Integer, Msg As UInt32, wParam As UInteger, lParam As Integer) As Integer
Call SendMessage(textarea1.handle, EM_SETTARGETDEVICE, dc, 1000000)

Declare Function ReleaseDC Lib “User32.dll” Alias “ReleaseDC” (hWnd As Integer, hDC As Integer) As Int32
Call ReleaseDC(textarea1.handle, dc)[/code]

This should do what I think you’re asking, it’s setting the wrap size very large essentially turning off wrap and it shouldn’t auto scroll any more.