PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: WinFBE 3.0.0 Beta 3 - ListBox - Horizontal ScrollBar  (Read 268 times)

SeaVipe

  • Senior Member
  • ***
  • Posts: 437
  • Windows 10
WinFBE 3.0.0 Beta 3 - ListBox - Horizontal ScrollBar
« on: April 26, 2022, 02:35:56 PM »

Hi Paul, ListBox Horizontal ScrollBar is visible but disabled regardless of the width of the items. Vertical ScrollBar works as expected.
« Last Edit: April 26, 2022, 08:01:48 PM by SeaVipe »
Logged
Clive Richey
You're Either Part Of The Solution, Or You're The Problem.
#StaySafe, Always  Keep A Safe #SocialDistance, #WashYourHands Often and please, #StayHome!

philbar

  • Little Newbie
  • *
  • Posts: 31
Re: WinFBE 3.0.0 Beta 3 - ListBox - Horizontal ScrollBar
« Reply #1 on: April 27, 2022, 02:42:32 PM »

Hi Clive,

As far as I can tell, list boxes have kind of strained diplomatic relations with horizontal scrolling. Try adding one of these to your Form_Load event:

Code: [Select]
sendmessage(frmmain.list1.hwindow, LB_SETHORIZONTALEXTENT, 500, 0)
where 500 (or whatever) is the number of pixels of scroll you'll allow. Its default value is 0, so there's no scrolling. By the way, if you try to use the horizontal extent property in the toolbox, you may regret it.

Phil
Logged

SeaVipe

  • Senior Member
  • ***
  • Posts: 437
  • Windows 10
Re: WinFBE 3.0.0 Beta 3 - ListBox - Horizontal ScrollBar
« Reply #2 on: April 27, 2022, 03:25:38 PM »

Thank you, Phil,
I tried the toolbox HorizontalExtent property earlier; I promptly set that value back to 0!
I also tried your suggestion:
Code: [Select]
sendmessage(frmmain.list1.hwindow, LB_SETHORIZONTALEXTENT, 500, 0)but it had no effect on the scrollbar - it remained disabled. As the list box does not update its horizontal extent dynamically, I experimented calling it in the procedure that updates the ListBox - still no effect.
If all else fails, I could simply place the too-long text value in the ListBox ToolTip.
I'll continue reviewing this issue and report my findings here.
Logged
Clive Richey
You're Either Part Of The Solution, Or You're The Problem.
#StaySafe, Always  Keep A Safe #SocialDistance, #WashYourHands Often and please, #StayHome!

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 9497
  • Windows 10
    • PlanetSquires Software
Re: WinFBE 3.0.0 Beta 3 - ListBox - Horizontal ScrollBar
« Reply #3 on: April 28, 2022, 08:02:23 AM »

It does look like (for whatever reason) the HorizontalExtent property is not defined when you change its value in the PropertyList of the visual designer. I have logged that as an issue to be fixed. Once Version 3 is released I will shift my focus to the visual designer and update/fix/expand that framework.

In the meantime, I tried a couple of tests and place LB_SETHORIZONTALEXTENT in the Form Load handler seems to work.
Code: [Select]
''
''
Function frmMain_Load( ByRef sender As wfxForm, ByRef e As EventArgs ) As LRESULT
   SendMessage(frmMain.List1.hWindow, LB_SETHORIZONTALEXTENT, 500, 0)
   frmMain.List1.Enabled = true
   dim as CWSTR wszText
   for i as long = 0 to 100
      wszText = "This is a very long line of text, does the scrollbar work?"
      frmMain.List1.Items.Add( wszText )
   next
   frmMain.List1.BackColor = colors.Beige
   Function = 0
End Function

Be sure to set the "500" value to a sufficiently high enough value given the width of your listbox and the text in it.
Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

SeaVipe

  • Senior Member
  • ***
  • Posts: 437
  • Windows 10
Re: WinFBE 3.0.0 Beta 3 - ListBox - Horizontal ScrollBar
« Reply #4 on: April 28, 2022, 01:08:08 PM »

Thanks, Paul & Phil,
This worked for me:

Code: [Select]
SendMessage(frmMain.List1.hWindow, LB_SETHORIZONTALEXTENT, 1500, 0)The key here is to set wParam > than the width of the ListBox, not the number of pixels > the width of the ListBox. In my case, 500 did not enable the H ScrollBar on a ListBox width of 1100, a value of 1500 did.
Logged
Clive Richey
You're Either Part Of The Solution, Or You're The Problem.
#StaySafe, Always  Keep A Safe #SocialDistance, #WashYourHands Often and please, #StayHome!

philbar

  • Little Newbie
  • *
  • Posts: 31
Re: WinFBE 3.0.0 Beta 3 - ListBox - Horizontal ScrollBar
« Reply #5 on: April 28, 2022, 03:20:15 PM »

Okay, I think that means I also misread the description of LB_SETHORIZONTALEXTENT. The number is the width of the "virtual" listbox, not the number of pixels added.

But now that I'm looking at it, has anybody else noticed the odd quirk that happens when you scroll right to reveal the hidden characters? It's not fatal, because the text is drawn properly as soon as the mouse touches it, but it's a little surprising. I see it on my work computer and at home.

Logged

SeaVipe

  • Senior Member
  • ***
  • Posts: 437
  • Windows 10
Re: WinFBE 3.0.0 Beta 3 - ListBox - Horizontal ScrollBar
« Reply #6 on: April 28, 2022, 06:32:33 PM »

Yes, same "odd quirk" on mine as well.
Logged
Clive Richey
You're Either Part Of The Solution, Or You're The Problem.
#StaySafe, Always  Keep A Safe #SocialDistance, #WashYourHands Often and please, #StayHome!