Hi all,
Is there a way to temporarily hide a trackbar created with the WINLIB3 library?
Unlike the other UI elements (edit boxes, check boxes and the like, created using WINLIB5) that I have added to the main window, trackbars don't seem to be affected by SYS "ShowWindow". I have spent a fair while googling and reading the MS documentation, but have drawn a blank. My solution has just been to destroy the trackbar with PROC_removetrackbar and recreate it when needed again, which strikes me as a little inelegant.
Thanks in advance for any assistance!
Simon
Hiding a WINLIB3 trackbar
Re: Hiding a WINLIB3 trackbar
That's very strange, because on a quick experiment here trackbars do seem to be affected by ShowWindow (using Windows 10). I tested it by adding this line to WIDGETS.BBC (in the EXAMPLES\WINDOWS folder) immediately after the REPEAT:
Code: Select all
IF (TIME MOD 200) < 100 THEN SYS "ShowWindow", !tb%, 0 ELSE SYS "ShowWindow", !tb%, 5

-
- Posts: 5
- Joined: Tue 03 Apr 2018, 12:45
Re: Hiding a WINLIB3 trackbar
Thanks Richard.
I hadn't spotted that the WINLIB3 functions return a pointer to the window handle, rather than the handle itself, so I was just using
All working now.
best wishes
Simon
I hadn't spotted that the WINLIB3 functions return a pointer to the window handle, rather than the handle itself, so I was just using
Code: Select all
SYS "ShowWindow", tb%, 0
best wishes
Simon
Re: Hiding a WINLIB3 trackbar
From the main Help documentation: 'SYS "SendMessage", !tb%, TBM_SETPOS, 1, trackpos% (note the exclamation mark in !tb%)'.
-
- Posts: 5
- Joined: Tue 03 Apr 2018, 12:45
Re: Hiding a WINLIB3 trackbar
Yes, my own program does that properly, so I have no excuse for getting this wrong...RichardRussell wrote: ↑Thu 30 Apr 2020, 12:35 From the main Help documentation: 'SYS "SendMessage", !tb%, TBM_SETPOS, 1, trackpos% (note the exclamation mark in !tb%)'.
Simon