473,854 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to programmaticall y scroll a panel?

What method can I call to programmaticall y scroll a panel?

There is ScrollControlIn toView() but I don't have a control to scroll
into view. I just want the panel to scroll up by 100 pixels.

Setting AutoScrollPosit ion doesn't seem to work either. The values I
set are not honored, and are apparently modified by the framework.

By the way, what I am trying to implement is the behavior seen in
Notepad (and other Windows apps) where you hold the mouse button down
and drag the mouse below the window, and the contents keep scrolling
up while the mouse button is held down. I am using a timer to achieve
this. In the timer event handler, I want to programmaticall y scroll
the panel up.
Nov 15 '05
14 49970
> I got the same error too. Also new to C#, "calling the SendMessage API
function through the P/Invoke layer" translates to "use floober via blavar
to get proobser"... please post code example for us newbies so we know what this means!
This means nothing else thatn calling native code which resides in a dll
from a c# app:

since c# lacks header files you declare the function like that:

[DllImport("gdi3 2")]
public static extern IntPtr SelectObject(
IntPtr hdc, // handle to DC
IntPtr hgdiobj // handle to object
);

and then simply call it like you would call any other method.
In the meantime, I found that this will scroll a panel too:

myPanel.AutoScr ollPosition = new Point(0,1152);

Change Point(0,y) so that y is how far you want to scroll up in panel.

Thats exactly how I solved my problem too!

--
cody

[Freeware, Games and Humor]
www.deutronium.de.vu || www.deutronium.tk
Nov 16 '05 #11
I got the same error too. Also new to C#, "calling the SendMessage API
function through the P/Invoke layer" translates to "use floober via blavar
to get proobser"... please post code example for us newbies so we know what
this means!
In the meantime, I found that this will scroll a panel too:

myPanel.AutoScr ollPosition = new Point(0,1152);

Change Point(0,y) so that y is how far you want to scroll up in panel.

-Joey
Nov 16 '05 #12
> I got the same error too. Also new to C#, "calling the SendMessage API
function through the P/Invoke layer" translates to "use floober via blavar
to get proobser"... please post code example for us newbies so we know what this means!
This means nothing else thatn calling native code which resides in a dll
from a c# app:

since c# lacks header files you declare the function like that:

[DllImport("gdi3 2")]
public static extern IntPtr SelectObject(
IntPtr hdc, // handle to DC
IntPtr hgdiobj // handle to object
);

and then simply call it like you would call any other method.
In the meantime, I found that this will scroll a panel too:

myPanel.AutoScr ollPosition = new Point(0,1152);

Change Point(0,y) so that y is how far you want to scroll up in panel.

Thats exactly how I solved my problem too!

--
cody

[Freeware, Games and Humor]
www.deutronium.de.vu || www.deutronium.tk
Nov 16 '05 #13
I got the same error too. Also new to C#, "calling the SendMessage API
function through the P/Invoke layer" translates to "use floober via blavar
to get proobser"... please post code example for us newbies so we know what
this means!
In the meantime, I found that this will scroll a panel too:

myPanel.AutoScr ollPosition = new Point(0,1152);

Change Point(0,y) so that y is how far you want to scroll up in panel.

-Joey
Nov 16 '05 #14
> I got the same error too. Also new to C#, "calling the SendMessage API
function through the P/Invoke layer" translates to "use floober via blavar
to get proobser"... please post code example for us newbies so we know what this means!
This means nothing else thatn calling native code which resides in a dll
from a c# app:

since c# lacks header files you declare the function like that:

[DllImport("gdi3 2")]
public static extern IntPtr SelectObject(
IntPtr hdc, // handle to DC
IntPtr hgdiobj // handle to object
);

and then simply call it like you would call any other method.
In the meantime, I found that this will scroll a panel too:

myPanel.AutoScr ollPosition = new Point(0,1152);

Change Point(0,y) so that y is how far you want to scroll up in panel.

Thats exactly how I solved my problem too!

--
cody

[Freeware, Games and Humor]
www.deutronium.de.vu || www.deutronium.tk
Nov 16 '05 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
7528
by: Boaz Ben-Porat | last post by:
Hi all Is there a way to simulate a click on a scrollbar (horizontal) of a FataGrid ? I need to programmatically scroll the grid to the right/left upon some condition, when the total width of the grid columns is greater then the grid`s rectangle. TIA
1
2697
by: _Andy_ | last post by:
I've seen this question asked before, but no answer is visible. Is it possible to determine when the user scrolls an auto-scroll panel?
2
2356
by: Leif Eirik Olsen | last post by:
Hi, I have some code I'm using in a CompactFramework project. The code works as expected on the CF, but when using this code on the FullFramework (FF) it does not work the way I want. It copiles ok, but the screendrawing is not working 100%. What the code is supposed to do: Draw recieved values to a panel so values are displayed countiniously as a scrolling graph.
4
3219
by: Anthony Morgan | last post by:
I have a project that is written in vb6 that I am converting logic from it into VB.net. I have 2 datagrid when you scroll 1, it scrolls the other. This was easy to do in VB6, but I cannot fidure out how to do it in vb.net. The funtionallity is 2 grids one over the other. When I horizontally scroll the lower grid the top grid should scroll as well. I don't care about the vertical scroll.
1
11668
by: Axeman | last post by:
I have an AJAX enabled web form with several data-filled GridView controls. The users accessing this web app will navigate the site via touch-screen monitors (i.e.: no mouse). As a result, I need an easy way for them to scroll the GridViews when the data is not visible. I want them to click on a button, which will then accordingly scroll the grid up or down. I have tried all the various combinations of the suggestions that I could find: ...
2
2211
by: trint | last post by:
I have a series of gridviews (1 thru 6). At about gridview 3, I need the page to horizontally scroll to the end. Any help is appreciated. Thanks, Trint
2
4616
by: Rich Raffenetti | last post by:
In the listview control I can set the highlighted item with listview.focus() listview.items(integerValue).selected=true How do I programmatically scroll the pane of the details view to bring the highlighted item into the window? multiselect is false.
4
4693
by: mateusz.zajakala | last post by:
Hi, I have panel (with autoscroll property) on which I'm dynamicaly adding of controls. When I want to scroll my panel using scrollbars it freezes all the controls added on that panel, makes them nasty stretch. Is there any way to prevent that stretch, and scroll panel smoothly? I tried to add DoEvents() to Scroll event of my panel, which prevent
0
1749
by: Steve | last post by:
Hi All I have a Tablelayoutpanel in VS 2005 which I populate in code with datagridviews As my program runs on Touchscreen computers I would like to add up and down scroll buttons, as the default scrollbars are hard to target I do it within datagridview controls using the datagridview FirstDisplayedScrollingRowIndex property
0
9903
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11044
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10767
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10375
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9526
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7927
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5754
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5952
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3194
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.