Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: MFC
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 3-Nov-10 0:39am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

I am facing the same issue on Win XP when we put the Win 98 classic style. Any Suggestion ??
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

This is a .NET bug and has been fixed in .NET 4.5
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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!
  Permalink  
Comments
Raghava Hosur at 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 at 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 at 5-Feb-11 16:59pm
   
Further Google research uncovered the following article:
http://connect.microsoft.com/VisualStudio/feedback/details/304330/scroll-bar-disappears
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

call SetScrollSizes in OnInitialUpdate of the view.
  Permalink  
v2

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

  Print Answers RSS
0 OriginalGriff 467
1 CPallini 400
2 Sergey Alexandrovich Kryukov 348
3 BillWoodruff 254
4 George Jonsson 251
0 OriginalGriff 5,370
1 CPallini 4,360
2 Sergey Alexandrovich Kryukov 3,822
3 George Jonsson 3,037
4 Gihan Liyanage 2,435


Advertise | Privacy | Mobile
Web04 | 2.8.140916.1 | Last Updated 28 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100