Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ctl32_scrollbar

Status
Not open for further replies.

AlastairP

Technical User
Feb 8, 2011
286
AU
Has anyone experienced this with the above class:

When the container class is moved/resized the container class moves, but the scroll bar remains 'floating' in its original postion

Probably need a way to move the object in sync with the container class using the windows handle?

Any suggestions would be welcome

Alastair
 
A scrollbar keeps in place normally, doesn't it? It's not a title bar moving with a form. Scrollbr should be used at the form border to scroll whole form content, so the moving container is clipped by form border. Or you clip a container by an outer container.

Bye, Olaf.
 
Alastair,

Just out of curiosity, why are you using this control? Are you aware that an entire form can have its own native scrollbars? And you can also set up a scrolling region within a form (albeit with some limitations)?

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Hi Olaf,
In this case it's a little more complecated.
What I have made is what I call "Slideout_Widget"

This class has a container that "slides" out from the page top or edge for a few seconds and displays relevent info to the user.
At this stage, the only way around the problem I am experiening, is to remove the scroll bar while sliding in & out and recreate the scroll bar when the slide out container has reached its final desitination.

The above gets around the problem, but it would have been nice just to be able to move the scroll bar...

Alastair
 
Mike,

This is a touch screen application.
I found that with some of the native VFP controls, the scroll bars did not behave as expected on a touch screen, so for grids I replaced the scroll bar.

Has been working just fine until I decided to make a container that moves.

Alastair
 
OK, so the situation is the scrollbar moves the container position, and your code sliding the container, too. And that disrupts each other and leads to wrong positioning. Well, that's what you get in such situations, it doesn't work out and I have no short idea to solve that. Hiding or Disabling the scrollbar while sliding should work, yes.

Anyway, shouldn't that be a separate form? You want the container to show up in the end of the sliding at a certain position, no matter how the other part of the form is scrolled, don't you? And the scrollbar shouldn't influence that, should it?`Then the easiest may be to not put that container on the form scrolled, but do this as a separate form. To get the sliding in effect with clipping you position the secondary form relative to the main form, you let it's height or width rise and that looks like a slide in.

Bye, Olaf.
 
Hi Olaf,

Not quite like that

I have a container with a command button. The container is the same size as the command button
The container is transparent with no border

I have another container which is added to the class as needed.
This conatiner is the "slide out" container and can have a grid, or other controls and info on it

When the "Slide out" activates, the parent container resizes to page width and height, so the slide out container is visible without being clipped
When retracted, the parent container then resizes to the original size.

I have done it this way because my "Widget" class can be reused anywhere, I just have to add the specific slide out container whenever I need.

In regards to the scroll bar working better if it was on a form, that may be the case as the form would be moving location, not the controls on it.
If it becomes a real problem, I could redesign the class as a form instead

Alastair
 
I think I have to see it to understand it exactly, but anyway, it seems you have found a workaround yourself.

Bye, Olaf.
 
I think I have to see it to understand it exactly, but anyway, it seems you have found a workaround yourself.

Bye, Olaf.
 
I think I have to see it to understand it exactly, but anyway, it seems you have found a workaround yourself.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top