By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,570 Members | 970 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,570 IT Pros & Developers. It's quick & easy.

Scrollbars in form

P: n/a
Hi,

Can i cause scrollbars to be activate only on part of the form?
Meaning"

I have buttons in top of form which i don't want scrollbars to scroll
this button. I want this button to be available even if acroll bars are
activated.
TIA.

Jan 6 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi,
if the button is a descendant control of the control which is scrolling
then it will be scrolled along with the control it is part of. To stop your
button scrolling you could either change it's location as the control is
scrolling so it appears to stay in the same place, but I do not recommend
this as the button will jerk around as it is moved, or another alternative is
to move the button outside of the control's child control collection that is
being scrolled, but place it ontop of the control location wise so that it
appears to be in the scrollable area.

For example you can add a button and a panel to the forms Controls
collection, make the panel scrollable and have it contain all of the content,
not the form directly, then move your button ontop of the panel (make sure
it's z-order is greater than that of the panel i.e call BringToFront()) and
now you can scroll the panel but the button will remain stationary.

Mark.
--
http://www.markdawson.org
"Er********@gmail.com" wrote:
Hi,

Can i cause scrollbars to be activate only on part of the form?
Meaning"

I have buttons in top of form which i don't want scrollbars to scroll
this button. I want this button to be available even if acroll bars are
activated.
TIA.

Jan 6 '07 #2

P: n/a

Mark R. Dawson wrote:
Hi,
if the button is a descendant control of the control which is scrolling
then it will be scrolled along with the control it is part of. To stop your
button scrolling you could either change it's location as the control is
scrolling so it appears to stay in the same place, but I do not recommend
this as the button will jerk around as it is moved, or another alternative is
to move the button outside of the control's child control collection that is
being scrolled, but place it ontop of the control location wise so that it
appears to be in the scrollable area.

For example you can add a button and a panel to the forms Controls
collection, make the panel scrollable and have it contain all of the content,
not the form directly, then move your button ontop of the panel (make sure
it's z-order is greater than that of the panel i.e call BringToFront()) and
now you can scroll the panel but the button will remain stationary.

Mark.
--
http://www.markdawson.org
"Er********@gmail.com" wrote:
Hi,

Can i cause scrollbars to be activate only on part of the form?
Meaning"

I have buttons in top of form which i don't want scrollbars to scroll
this button. I want this button to be available even if acroll bars are
activated.
TIA.
Hi Mark,

I used Panel as you suggested. I set the panel to autoscroll true and
the button is outside of the panel and it is not scrolled. thanks for
your suggestion.

Jan 7 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.