Click here to Skip to main content
15,886,067 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I am working with CWnd derived class, created with WS_VSCROLL.
Correctly updating the scrollbar positions, ranges... using setscrollInfo. But when we are resizing the container window (dialog) suddenly scrollbar disappears for some window sizes. If i increase further or decrease furhter, again the scrollbar appears.
What can be the best method to stick the scrollbar according to the window size.
Please reply me if you need any additional inputs.

Thanks in advance
Best Regards
Raghav
Posted

The scrollbars are normally only shown when needed and hidden otherwise. You can use ShowScrollBar to control this.

http://msdn.microsoft.com/en-us/library/bb787601%28VS.85%29.aspx[^]

Some additional info:
http://msdn.microsoft.com/en-us/library/bb787527%28VS.85%29.aspx#scroll_bar_visibility[^]

Good luck!
 
Share this answer
 
Comments
Raghava Hosur 4-Nov-10 6:14am    
Hi,
Thank you for the reply. I do understand the scrollbar enable/disable functionality. But my situation is at one particular size of window, the scrollbar is disappearing. But if reduce/increase the window size the scrollbar is coming again. What can be the reason. If the scroll bar disappearing, even if I reduce the window size further also it should remain disappear. But surprisingly it is getting enabled. My implementation is to display the scrollbar always, irrespecitve of the min max sizes. Even if the content is of single page, then also I want to display the scrollbar.
Please address.
Once again Thanks in advance.
Best Regards
Raghav
polczym 5-Feb-11 16:56pm    
I too am encountering a similar behaviour when using the .Net Windows Forms Textbox control. I have both scrollbars enabled, and when I perform a resize, the respective scrollbar disappears. I'm sure our problems are related. Hopefully Microsoft will reply with an answer or fix.
polczym 5-Feb-11 16:59pm    
Further Google research uncovered the following article:
http://connect.microsoft.com/VisualStudio/feedback/details/304330/scroll-bar-disappears
call SetScrollSizes in OnInitialUpdate of the view.
 
Share this answer
 
v2
I am facing the same issue on Win XP when we put the Win 98 classic style. Any Suggestion ??
 
Share this answer
 
This is a .NET bug and has been fixed in .NET 4.5
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900