Doubts About control Panel

axy
05-15-2006, 09:30 AM
hi this is my first message :D and i have somo doubts about control panel.

1. I try to control the scroll of the panel with the wheel of the mouse but i don't know how to do that some one can help???? :(

2. Now i have an aplication that add picture box to a panel dinamic, but when i add a picturebox when the scroll is at the top everithing is ok, but when the user scroll the panel and add a new picturebox, the new picture box is added but not in the position that i want, for example:

i add 10 picture box, the position is something lake this:

pic1.location(10,10)
pic2.location(10,110)
pic3.location(10,210)
pic4.location(10,310)
pic5.location(10,410)

when i add other picture box the next position is (10, 510), but when the panel is scrolled the 510 pixels are counted from the top of the panel scrolled but not at the top of the panel position. Someone knows haw can i solve this problem???? :confused:

Greetings

iosys
05-15-2006, 12:29 PM
I've been working on this exact same concept. The first way I solved it was by adding all the items before the panel can ever be scrolled by the user. The second way, which came by luck, was that I would add controls to a panel which was inside of another panel. The outermost panel would have autoscroll enabled, while the inner panel would have autoscroll disabled and just resize to fit whatever controls you added to it.

You could also try setting the autoscrollposition back to zero, adding the control, then returning the autoscrollposition to where it was. Or you could figure out how much to offset the control when you add it by checking the autoscrollposition.

axy
05-15-2006, 12:54 PM
thanks i use the last form that you said, with the autoscrollposition and works OK.

:D :D :D

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum