ShowScrollBar fails to remove scrollbars with animation on Vista/Windows 7

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
<span style="widows:2; text-transform:none; text-indent:0px; border-collapse:separate; font:medium Times New Roman; white-space:normal; orphans:2; letter-spacing:normal; color:#000000; word-spacing:0px <span style="font-family:verdana,geneva,lucida,lucida grande,arial,helvetica,sans-serif; font-size:13px Im
trying to remove both scrollbars in my custom control using the following code:<br/>
<div style="margin:5px 20px 20px
<div style="font:11px verdana,geneva,lucida,lucida grande,arial,helvetica,sans-serif; margin-bottom:2px
Code:
<pre dir="ltr" style="text-align:left; overflow-x:auto; overflow-y:auto; background-color:#dddddd; margin:0px; width:900px; height:34px; color:#000000; border:1px inset; padding:3px ShowScrollBar(hWnd, SB_BOTH, FALSE);[/code]

I should say that it works probably 80% of the time. And sometimes I get an artifact of a scrollbar (that I cannot click) left out on the screen. I tried adding the following right after that call, but it didnt seem to help either:<br/>
<div style="margin:5px 20px 20px
<div style="font:11px verdana,geneva,lucida,lucida grande,arial,helvetica,sans-serif; margin-bottom:2px
Code:
<pre dir="ltr" style="text-align:left; overflow-x:auto; overflow-y:auto; background-color:#dddddd; margin:0px; width:900px; height:50px; color:#000000; border:1px inset; padding:3px InvalidateRect(hWnd, NULL, TRUE);<br/><span style="font-size:x-small <font size="2" style="font-size:x-small RedrawWindow(hWnd, NULL, NULL, SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOMOVE); </font>
UpdateWindow(hWnd);<br/> [/code]

I also made a sample project to demonstrate it. You can download it here:<br/>
http://www.codeguru.com/forum/attachment.php?attachmentid=28361&d=1304800109 http://www.codeguru.com/forum/attachment.php?attachmentid=28361&d=1304800109
<span style="widows:2; text-transform:none; text-indent:0px; border-collapse:separate; font:medium Times New Roman; white-space:normal; orphans:2; letter-spacing:normal; color:#000000; word-spacing:0px <span style="font-family:verdana,geneva,lucida,lucida grande,arial,helvetica,sans-serif; font-size:13px <span style="widows:2; text-transform:none; text-indent:0px; border-collapse:separate; font:medium Times New Roman; white-space:normal; orphans:2; letter-spacing:normal; color:#000000; word-spacing:0px <span style="font-family:verdana,geneva,lucida,lucida grande,arial,helvetica,sans-serif; font-size:13px Can
you try it on your end and see if you get the same result?<br/>
<br/>
For this to work you need the following:<br/>
<br/>
1. Windows Vista, or Windows 7 (surprisingly this will work OK on XP)<br/>
<br/>
2. Default visual styles enabled (maybe "glass effect" too) for the scrollbar to be animated. See my screenshot for how it looks on my end:<br/>
http://www.codeguru.com/forum/attachment.php?attachmentid=28360&stc=1&d=1304800096 http://www.codeguru.com/forum/attachment.php?attachmentid=28360&stc=1&d=1304800096 <br/>
<br/>
Run the sample project. It should animate what happens....


View the full article
 
Back
Top