473,387 Members | 1,497 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

ListView WndProc constant search

Hello,

I have created a new ListView control that inherits from ListView control.
In the WndProc override subroutine, I have been able to find and use those
constants :
Private Const SBM_SETSCROLLINFO As Integer = &HE9
Private Const WM_HSCROLL As Integer = &H115
Private Const WM_VSCROLL As Integer = &H114

So i know when the user is using the scroll bar of the listview control.
What I need is the constant to know when the user changes the size of the
columns in the listview. I tried to find this value but with no success. Is
there Anybody who knows this value?

thank you

--
Marc R.
E-mail
Dim strAddr As String =Convert.ToString(String.Format("{0}.{2}@{3}.{1}",
"mxrc", "cx", "robitxille", "xrs-solutions")).Replace("x", "a")
Nov 28 '05 #1
6 4161
Marc,
What I need is the constant to know when the user changes the size of the
columns in the listview. I tried to find this value but with no success. Is
there Anybody who knows this value?


I believe the header control will notify the listview with WM_NOTIFY
(&H4E) messages where the code in the NMHDR structure is
HDN_ITEMCHANGING (-300 or -320) or HDN_ITEMCHANGED (-301 or -321).
Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 28 '05 #2
"Marc Robitaille" <ma*******@videotron.caa> schrieb:
I have created a new ListView control that inherits from ListView control.
In the WndProc override subroutine, I have been able to find and use those
constants :
[...]
What I need is the constant to know when the user changes the size of the
columns in the listview. I tried to find this value but with no success.
Is there Anybody who knows this value?


If you are using .NET 2.0, check out the listview class'
'OnColumnWidthChanging' and 'OnColumnWidthChanged' methods.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 28 '05 #3
I am in vb.net. How can i translate this?

--
Marc R.
E-mail
Dim strAddr As String =Convert.ToString(String.Format("{0}.{2}@{3}.{1}",
"mxrc", "cx", "robitxille", "xrs-solutions")).Replace("x", "a")

"Mattias Sjögren" <ma********************@mvps.org> a écrit dans le message
de news: Og**************@TK2MSFTNGP14.phx.gbl...
Marc,
What I need is the constant to know when the user changes the size of the
columns in the listview. I tried to find this value but with no success.
Is
there Anybody who knows this value?


I believe the header control will notify the listview with WM_NOTIFY
(&H4E) messages where the code in the NMHDR structure is
HDN_ITEMCHANGING (-300 or -320) or HDN_ITEMCHANGED (-301 or -321).
Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Nov 29 '05 #4
I am using .NET 1.1
thank you

--
Marc R.
E-mail
Dim strAddr As String =Convert.ToString(String.Format("{0}.{2}@{3}.{1}",
"mxrc", "cx", "robitxille", "xrs-solutions")).Replace("x", "a")

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> a écrit dans le
message de news: uR**************@TK2MSFTNGP10.phx.gbl...
"Marc Robitaille" <ma*******@videotron.caa> schrieb:
I have created a new ListView control that inherits from ListView
control.
In the WndProc override subroutine, I have been able to find and use
those
constants :
[...]
What I need is the constant to know when the user changes the size of the
columns in the listview. I tried to find this value but with no success.
Is there Anybody who knows this value?


If you are using .NET 2.0, check out the listview class'
'OnColumnWidthChanging' and 'OnColumnWidthChanged' methods.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 29 '05 #5
I am in vb.net. How can i translate this?


I don't know what there is to translate. But I guess the code would
look something like this

Const WM_NOTIFY As Integer = &H4E
Const HDN_ITEMCHANGINGA As Integer = -300
Const HDN_ITEMCHANGINGW As Integer = -320

Protected Overrides Sub WndProc(ByRef m As Message)

If m.Msg = Wm_NOTIFY Then
Dim code As Integer = _
Marshal.ReadInt32(m.LParam, 4 + IntPtr.Size)
If code = HDN_ITEMCHANGINGA Or _
code = HDN_ITEMCHANGINGW Then
' ...
End If
End If

MyBase.WndProc(m)
End Sub
At the ... place in in the code you'd have to dereference m.LParam to
a NMHEADER struct, see if the pItem member is valid and if so
dereference that to a HDITEM struct. If its mask member includes
HDI_WIDTH then the width is changing and the new width is in the cxy
member. To prevent the change from happening you set m.Result to 1.
Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 29 '05 #6
Thank you

--
Marc R.
E-mail
Dim strAddr As String =Convert.ToString(String.Format("{0}.{2}@{3}.{1}",
"mxrc", "cx", "robitxille", "xrs-solutions")).Replace("x", "a")

"Mattias Sjögren" <ma********************@mvps.org> a écrit dans le message
de news: OP**************@TK2MSFTNGP12.phx.gbl...
I am in vb.net. How can i translate this?


I don't know what there is to translate. But I guess the code would
look something like this

Const WM_NOTIFY As Integer = &H4E
Const HDN_ITEMCHANGINGA As Integer = -300
Const HDN_ITEMCHANGINGW As Integer = -320

Protected Overrides Sub WndProc(ByRef m As Message)

If m.Msg = Wm_NOTIFY Then
Dim code As Integer = _
Marshal.ReadInt32(m.LParam, 4 + IntPtr.Size)
If code = HDN_ITEMCHANGINGA Or _
code = HDN_ITEMCHANGINGW Then
' ...
End If
End If

MyBase.WndProc(m)
End Sub
At the ... place in in the code you'd have to dereference m.LParam to
a NMHEADER struct, see if the pItem member is valid and if so
dereference that to a HDITEM struct. If its mask member includes
HDI_WIDTH then the width is changing and the new width is in the cxy
member. To prevent the change from happening you set m.Result to 1.
Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Nov 30 '05 #7

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

Similar topics

6
by: Anushya | last post by:
Hi I am using Listview and inherited listview control overriding WndProc & PreProcessMessage in ListView. I need this to customize listview to display only the page the user scrolls to. Since i...
0
by: Anushya | last post by:
Hi I am using Listview and inherited listview control overriding WndProc & PreProcessMessage in ListView. I need this to customize listview to display only the page the user scrolls to. Since i...
1
by: SlantyOD | last post by:
Hi All, I'm trying to tie two ListViews together so that when the user scrolls one, the other stays 'in sync'. Since there are no OnScroll events, and the scroll bar position is unavailable,...
2
by: Anushya devi | last post by:
Hi All I used listview and tried to update it by using Addrange. When the number of items is less, it works fine.. But I need to update nearly 200,000 items and it hangs. Also i need to add...
0
by: cyrille | last post by:
Hello from example from web i did a little code to avoiding columnHeader resize. this code seems to work well, but when I put a 'normal' ListView on the same Form than my overrided ListView it...
2
by: Juan Romero | last post by:
Hi guys, Does anyone know how to catch a listview scroll event? There are some things I need to refresh on the form, so I want to know when the user scrolls the listview control. Another...
11
by: rb | last post by:
Hi All, Is there a property or method to keep the headercolumns from being resized by the user for a listview? I am using Visual Basic in Visual Studio . net 2005 Thank you.
3
by: Michael.Suarez | last post by:
Is it me, or does it seem like they put no effort into creating the listview control in .Net. listview. A few gripes I have with .Net listview that aren't present in vb6: -Inability to set...
1
by: Michael M. | last post by:
HI all, When I add items to a Listview control, then clearing the items and adding more items my program seems to allocate a few KB of data and then not free the Memory. I noticed this about...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...

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.