?
Solved

How can scrollbars hide in RunTime?

Posted on 2003-02-20
7
Medium Priority
?
1,644 Views
Last Modified: 2013-12-27
Hi,
I created a window with scrollbar using CreateWindowEx with Style WS_CAPTION | WS_SYSMENU|WS_VSCROLL | WS_HSCROLL. and loaded images. I have a menu Item 'stretch view ',which will help to view large images to fit to screen so that a viewer can view whole image of large images without using scrollbar.Every thing worked fine except the scrollbar. My aim is to hide the scrollbar dynamically when i clicked on 'StretchView' and show it when I click in 'NormalView'.
I tried
       wndStyle |= WS_HSCROLL;
     wndStyle |= WS_VSCROLL;
            SetWindowLong(hWnd, GWL_STYLE, wndStyle);
       UpdateWindow(hWnd);
But no use..Pls Help me to find a solution of it
Thnx in advance
regards
Sujeesh

0
Comment
Question by:sujeeshlal
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
7 Comments
 
LVL 23

Accepted Solution

by:
chensu earned 800 total points
ID: 7995783
LONG lStyle = ::GetWindowLong(hWnd, GWL_STYLE);
// ASSERT(lStyle != 0);

lStyle &= ~WS_HSCROLL;
lStyle &= ~WS_VSCROLL;

LONG lOldStyle = ::SetWindowLong(hWnd, GWL_STYLE, lStyle);
// ASSERT(lOldStyle != 0);

BOOL bSucc = ::SetWindowPos(hWnd, NULL, 0, 0, 0, 0, SWP_DRAWFRAME | SWP_FRAMECHANGED | SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE);
// ASSERT(bSucc);
0
 

Author Comment

by:sujeeshlal
ID: 8006286
Thnx for ur help..but it help me to hide Horizontal scroll bar only.. But vertical scroll bar is still there.. I want to hide both of them..Y this happends so?
pls help
 
     
0
 
LVL 23

Expert Comment

by:chensu
ID: 8011880
It seems to me that somewhere in your code directly or indirectly adds the WS_VSCROLL style back. You will have to debug it.
0
 
LVL 6

Expert Comment

by:pcunite
ID: 38317601
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Learn how to use the free Acronis True Image app to easily transfer data between iPhones and Android phones.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses
Course of the Month15 days, 7 hours left to enroll

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question