Scroll a Panel in code ..

  • Thread starter Thread starter n. Smith
  • Start date Start date
N

n. Smith

Can anyone help here? I need to scroll a panel in code, because I
don't want to display the scroll bar on screen.

Any suggestions.

N.
 
What's in the panel? Controls or a picture? If they are controls you can
move them yourself .

Dim c as Control
For each c in Panel1.Controls
' New Location
c.Location = 'Wherever you want it
Next

If it's a picture just draw part that needs to be seen.
 
What an ingenious answer, that's quite impressive really.

Where is Hr H anyways ?

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
If U Need My Email ,Ask Me

Time flies when you don't know what you're doing
 
Welcome Back Herfreid, where have you been ?

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
If U Need My Email ,Ask Me

Time flies when you don't know what you're doing
 
Thanks for the suggestion. I was hoping there was a way of sending a
scroll value to a hidden scroll bar.

I'll be adding controls to a panel dynamically - kind of plugins for a
toolbar.

but I guess your idea might work as well as anything else.

Then I can maybe track the display of the first and last controls by
checking the bounds of the panel.

Thanks. I'll check it out.

Smith.
 
Private Declare Function SendMessage Lib "user32.dll" Alias
"SendMessageA" (ByVal hWnd As IntPtr, ByVal wMsg As Int32, ByVal wParam As
Int32, ByVal lParam As Int32) As Int32

Const WM_VSCROLL As Int32 = &H115
Const SB_LINEDOWN As Int32 = 1
Const SB_LINEUP As Int32 = 0

SendMessage(Panel1.Handle, WM_VSCROLL, SB_LINEDOWN, 0)
SendMessage(Panel1.Handle, WM_VSCROLL, SB_LINEUP, 0)


--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
If U Need My Email ,Ask Me

Time flies when you don't know what you're doing
 
Terry,

One Handed Man ( OHM - Terry Burns ) said:
Welcome Back Herfreid, where have you been ?

I am currently making my driver's license and thus don't have enough time to
be active in this group. I'll be back in a few days, hopefully...
 
Good Luck with your licence

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
If U Need My Email ,Ask Me

Time flies when you don't know what you're doing
 
Do what? I don't think you understood his question. He DOES'T want
scrollbars. Your code will only work with Autoscroll = True. Which will show
the scroll bar.
 
OK Dr Screwup, dont get your braids in a twizzle.

I didnt check this with Autoscroll set to true, however this doesent matter
because you can hide the scroll bars by dragging another panel to obscure
the virtical scroll bars and it works just fine.

HTH

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
If U Need My Email ,Ask Me

Time flies when you don't know what you're doing
 
Whatever.


One Handed Man ( OHM - Terry Burns ) said:
OK Dr Screwup, dont get your braids in a twizzle.

I didnt check this with Autoscroll set to true, however this doesent
matter
because you can hide the scroll bars by dragging another panel to obscure
the virtical scroll bars and it works just fine.

HTH

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
If U Need My Email ,Ask Me

Time flies when you don't know what you're doing
 
Nick,

Glad I could help. I was wondering if I understood your question because so
many people were offering you some silly suggestions like using the APIs to
send messages. Sometimes the simplest answer is the best answer.

Good luck on your project.
 
My solution worked exactly as you originally requested

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
If U Need My Email ,Ask Me

Time flies when you don't know what you're doing
 
My solution worked exactly as you originally requested

LOL! Duh! Panel1.AutoScrollPosition = New Point(3, 3) does the same
thing.
 
Christ your right, well knock me down with a feather; how long have you been
searching for that then cuz you didnt mention it yesterday ;-)

I'll remember that, thanks Dr Screwup

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
If U Need My Email ,Ask Me

Time flies when you don't know what you're doing
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top