H-Scrollbar

The place for threads about version 1.x of TimoSoft ExplorerTreeView.
Post Reply
aka
Lieutenant
Posts: 17
Joined: 05 Jan 2006, 12:27

H-Scrollbar

Post by aka »

Dear Timo,

after a long break due to healthy problems, I recently started VB6-programming again. Right now I work on several projects in which the ExplorerTreeView plays a major role. I would like to get rid of the horizontal scrollbar and tried it with following code (VB6/SP6, WinXP/SP1):

Private Sub Command1_Click()

Dim R As Rect
Dim Style As Long

'Toggle H-ScrollBar
Style = GetWindowLong(ETV.hWnd, GWL_STYLE)
If (Style And WS_HSCROLL) Then
Style = Style - WS_HSCROLL
Else
Style = Style Or WS_HSCROLL
End If
SetWindowLong ETV.hWnd, GWL_STYLE, Style
GetWindowRect ETV.hWnd, R
SetWindowPos ETV.hWnd, 0, R.Left, R.Top, R.Right - R.Left, R.Bottom - R.Top, SWP_FRAMECHANGED
ETV.SetFocus

End Sub

The Result is an empty ExplorerTreeView (Version 1.14.1/857), except the toolbox bitmap. Do you have any idea how to realize my wish?

Thanks in advance an best regards

aka
User avatar
TiKu
Administrator
Administrator
Posts: 832
Joined: 28 Sep 2004, 21:10
Location: München
Contact:

Re: H-Scrollbar

Post by TiKu »

Hi,

the toolbox bitmap is from the treeview's parent window (the UserControl window). I guess your call to SetWindowPos is wrong. Try this:

Code: Select all

SetWindowPos ETV.hWnd, 0, 0, 0, 0, 0, SWP_FRAMECHANGED Or SWP_NOREPOSITION Or SWP_NOSIZE Or SWP_NOZORDER
By the way, this code:

Code: Select all

Style = Style - WS_HSCROLL
is bad style. You should use this instead:

Code: Select all

Style = Style And Not WS_HSCROLL
HTH
TiKu
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!
aka
Lieutenant
Posts: 17
Joined: 05 Jan 2006, 12:27

Post by aka »

Hi TiKu,

thanks a lot for your fast reply. The code you gave me works very well.
Many thanks for this too.

Best regard
aka
Post Reply