473,624 Members | 2,637 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ScrollWindowEx and WM_VSCROLL for a ListBox control

Hi,

Is anyone able to give me an example on how to scroll the contents of
a ListBox without forcing the user to click on the scroll up/down
internal buttons?

=============== ===============
I am wanting to draw my own non-client area (including the scrollbar).
I have had the following ideas but each idea has failed:

1) Turn off the scrollbar using the "ShowScroll Bar" API
-Turns off the scrollbar but no scrollbar functionality (for
mousescroll etc.)...
-Requires manually scrolling the Listbox contents

2) Use WndProc to override WM_NCPAINT
-The scrollbar and its buttons are still painted whenever the
user clicks on it (WM_NCPAINT is not fired)
-It is likely that the paint is occurring within the
WM_NCLBUTTONDOW N event
-Will have to override WM_NCLBUTTONDOW N

3) Use WndProc to override WM_VSCROLL
-Not able to scroll contents (what actually happens in
WM_SCROLL? I am assuming it calls ScrollWindowEx)
=============== ===============

It would be most logical to handle the WM_NCPAINT and WM_NCLBUTTONDOW N
events so that there is no redraw of the scrollbar and then fire my
own WM_VSCROLL event.... then handle my own scrollbar and scrolling
routines.

Either way... does anyone please have an example of how to use
ScrollWindowEx in VB .Net???

/evan

Feb 28 '07 #1
0 2335

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

Similar topics

0
2388
by: Tony Liu | last post by:
Hi, I am having problem to scroll only a partion of a window using the ScrollWindowEx api function. The code is below and any help is pleased. Thanks in advance. private extern int ScrollWindowEx (IntPtr handle, int dx, int dy, Rectangle lprcScroll , Rectangle lprcClip, IntPtr hrgnUpdate, out Rectangle lprcUpdate, int fuScroll);
2
3422
by: Luca | last post by:
Hello, I'm using a windows form in which there is a standard ListBox control. I want to add/remove objects from the ArrayList associated to the ListBox, and I want the ListBox immediately shows graphically the change: e.g. if I remove an element from the ArrayList object, then that element should not be no more displayed in the list box. Actually i'm using this code below:
8
2875
by: Oddball | last post by:
Ok - I have a ListBox control and I'm ready to write my own DrawItem event handler. What I want to draw as the item is another control. I have created a user control that I would like to list in this listbox but I can't for the life of me figure out how to draw the control inside ListBox... I get as far as: private void lbImageList_DrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e)
6
2867
by: Chris Leuty | last post by:
I am populating a multiselect Listbox from a dataset, with the content of the listbox filled by one table, and the selections determined from another table. So far, I have been keeping the dataset a denormalized mirror of the database, but I'm not having much luck getting the selection logic down (I haven't found a 'hook' where I can access the listbox object as an object to set the listitem's selected property before it gets rendered).. ...
4
2446
by: Moe Sizlak | last post by:
Hi There, I am trying to return the value of a listbox control that is included as a user control, I can return the name of the control but I can't access the integer value of the selected item, what do I need to do in order to return the "option value" of the control? Moe !--- returned value of the control
3
2683
by: Scott Gunn | last post by:
I have looked all over the net for an example on how to use this function but got no joy, lots of jargon explaining the function but no examples. In VB.Net the hwnd has gone there was one in vb6 - I tried using Handle but nothing happens Can anyone shed some light on how to use this function or give an example? Many Thanks TBS
0
1170
by: Scott Gunn | last post by:
Hello I'm trying to scroll a region of graphics, the best way I can see is to use the ScrollWindowEx API because it is designed for doing this However it doesn't work correctly, Why? Here is my code: Public Class Win32
3
2420
by: Hugh O | last post by:
Hi, There is a ROW property on the Web Listbox control within VB.Net. The description states it is "The number of visible rows to display". I have tried setting this property in many different ways. It does not appear to do much of anything. I was trying to use it to control the actual size in rows of the list box on the Web page. But the size of the Web listbox seems to be fixed and controlled by the size of the control set in the...
3
4814
by: Ivonne Riedel | last post by:
Working on an incremental drawing algorithm I am facing a problem PInvoking ScrollWindowEx: The code is as follows... C#: public static extern int ScrollWindowEx(IntPtr hWnd, int dx, int dy, IntPtr scrollRect, IntPtr clipRect, IntPtr hrgn, ref Rectangle updateRect, uint flags);
0
8251
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
8688
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...
0
8635
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8352
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
7178
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
6115
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
5570
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
1800
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1496
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.