473,666 Members | 2,065 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Listview columnheader question

rb
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.

rb

Jul 29 '06 #1
11 1385
A bit of WndProc overriding should do the trick:
http://groups.google.com/group/micro...fbdea8e5?hl=sv

/claes

"rb" <rb*****@comcas t.netwrote in message
news:B9******** *************** *******@comcast .com...
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.

rb

Jul 31 '06 #2
JR
I don't get an error when I import this code in 2003 so I think it must work
also in 2003.

I get the message : Me.lstPartijen. WndProc = &H4E
Jan
How do I override the listviews property
"Claes Bergefall" <lo*****@nospam .nospamschreef in bericht
news:Os******** ******@TK2MSFTN GP03.phx.gbl...
>A bit of WndProc overriding should do the trick:
http://groups.google.com/group/micro...fbdea8e5?hl=sv

/claes

"rb" <rb*****@comcas t.netwrote in message
news:B9******** *************** *******@comcast .com...
>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.

rb


Jul 31 '06 #3
JR
sorry wrong message.
I get the messageon line Me.lstPartijen. WndProc = &H4E. Is not accesseble
becouse it is protected

Jan

"JR" <x.*@x.x.schree f in bericht
news:Wv******** *************** @phobos.telenet-ops.be...
>I don't get an error when I import this code in 2003 so I think it must
work also in 2003.

I get the message : Me.lstPartijen. WndProc = &H4E
Jan
How do I override the listviews property
"Claes Bergefall" <lo*****@nospam .nospamschreef in bericht
news:Os******** ******@TK2MSFTN GP03.phx.gbl...
>>A bit of WndProc overriding should do the trick:
http://groups.google.com/group/micro...fbdea8e5?hl=sv

/claes

"rb" <rb*****@comcas t.netwrote in message
news:B9******* *************** ********@comcas t.com...
>>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.

rb



Jul 31 '06 #4
That line doesn't make any sense. WndProc is a protected method. You can't
assign anything to it.

You need to use an inherited ListView. Did you copy the code in the link I
posted?

/claes

"JR" <x.*@x.x.wrot e in message
news:5D******** **************@ phobos.telenet-ops.be...
sorry wrong message.
I get the messageon line Me.lstPartijen. WndProc = &H4E. Is not accesseble
becouse it is protected

Jan

"JR" <x.*@x.x.schree f in bericht
news:Wv******** *************** @phobos.telenet-ops.be...
>>I don't get an error when I import this code in 2003 so I think it must
work also in 2003.

I get the message : Me.lstPartijen. WndProc = &H4E
Jan
How do I override the listviews property
"Claes Bergefall" <lo*****@nospam .nospamschreef in bericht
news:Os******* *******@TK2MSFT NGP03.phx.gbl.. .
>>>A bit of WndProc overriding should do the trick:
http://groups.google.com/group/micro...fbdea8e5?hl=sv

/claes

"rb" <rb*****@comcas t.netwrote in message
news:B9****** *************** *********@comca st.com...
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.

rb



Aug 1 '06 #5
JR
Yes. I copyed into a new class module.

Must I place it somewhere else?

Jan
"Claes Bergefall" <lo*****@nospam .nospamschreef in bericht
news:OW******** ******@TK2MSFTN GP03.phx.gbl...
That line doesn't make any sense. WndProc is a protected method. You can't
assign anything to it.

You need to use an inherited ListView. Did you copy the code in the link I
posted?

/claes

"JR" <x.*@x.x.wrot e in message
news:5D******** **************@ phobos.telenet-ops.be...
>sorry wrong message.
I get the messageon line Me.lstPartijen. WndProc = &H4E. Is not
accesseble becouse it is protected

Jan

"JR" <x.*@x.x.schree f in bericht
news:Wv******* *************** *@phobos.telene t-ops.be...
>>>I don't get an error when I import this code in 2003 so I think it must
work also in 2003.

I get the message : Me.lstPartijen. WndProc = &H4E
Jan
How do I override the listviews property
"Claes Bergefall" <lo*****@nospam .nospamschreef in bericht
news:Os****** ********@TK2MSF TNGP03.phx.gbl. ..
A bit of WndProc overriding should do the trick:
http://groups.google.com/group/micro...fbdea8e5?hl=sv

/claes

"rb" <rb*****@comcas t.netwrote in message
news:B9***** *************** **********@comc ast.com...
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.
>
rb
>




Aug 1 '06 #6
No that's fine.

You say you get an error on the line Me.lstPartijen. WndProc = &H4E. Where
does that line come from? Show your code

/claes
"JR" <x.*@x.x.wrot e in message
news:0B******** *************** @phobos.telenet-ops.be...
Yes. I copyed into a new class module.

Must I place it somewhere else?

Jan
"Claes Bergefall" <lo*****@nospam .nospamschreef in bericht
news:OW******** ******@TK2MSFTN GP03.phx.gbl...
>That line doesn't make any sense. WndProc is a protected method. You
can't assign anything to it.

You need to use an inherited ListView. Did you copy the code in the link
I posted?

/claes

"JR" <x.*@x.x.wrot e in message
news:5D******* *************** @phobos.telenet-ops.be...
>>sorry wrong message.
I get the messageon line Me.lstPartijen. WndProc = &H4E. Is not
accesseble becouse it is protected

Jan

"JR" <x.*@x.x.schree f in bericht
news:Wv****** *************** **@phobos.telen et-ops.be...
I don't get an error when I import this code in 2003 so I think it must
work also in 2003.

I get the message : Me.lstPartijen. WndProc = &H4E
Jan
How do I override the listviews property
"Claes Bergefall" <lo*****@nospam .nospamschreef in bericht
news:Os***** *********@TK2MS FTNGP03.phx.gbl ...
>A bit of WndProc overriding should do the trick:
http://groups.google.com/group/micro...fbdea8e5?hl=sv
>
/claes
>
"rb" <rb*****@comcas t.netwrote in message
news:B9**** *************** ***********@com cast.com...
>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.
>>
>rb
>>
>
>




Aug 2 '06 #7
JR
that is the line: Me.lstPartijen. WndProc = &H4E

the error is a blue underline in the vb editor

Private Sub FrmRonde_Load(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
Me.lstPartijen. WndProc = &H4E

End Sub

where lstpartijen is mij listview. It has 3 columns. I don't want them to
change the size. the column headers are Nonclickable
How must a do it. Can you give me some extra code, how to set each column
not to change? The class has no underline/error

Jan
"Claes Bergefall" <lo*****@nospam .nospamschreef in bericht
news:eg******** ******@TK2MSFTN GP06.phx.gbl...
No that's fine.

You say you get an error on the line Me.lstPartijen. WndProc = &H4E. Where
does that line come from? Show your code

/claes
"JR" <x.*@x.x.wrot e in message
news:0B******** *************** @phobos.telenet-ops.be...
>Yes. I copyed into a new class module.

Must I place it somewhere else?

Jan
"Claes Bergefall" <lo*****@nospam .nospamschreef in bericht
news:OW******* *******@TK2MSFT NGP03.phx.gbl.. .
>>That line doesn't make any sense. WndProc is a protected method. You
can't assign anything to it.

You need to use an inherited ListView. Did you copy the code in the link
I posted?

/claes

"JR" <x.*@x.x.wrot e in message
news:5D****** *************** *@phobos.telene t-ops.be...
sorry wrong message.
I get the messageon line Me.lstPartijen. WndProc = &H4E. Is not
accesseble becouse it is protected

Jan

"JR" <x.*@x.x.schree f in bericht
news:Wv***** *************** ***@phobos.tele net-ops.be...
>I don't get an error when I import this code in 2003 so I think it must
>work also in 2003.
>
I get the message : Me.lstPartijen. WndProc = &H4E
>
>
Jan
>
>
How do I override the listviews property
"Claes Bergefall" <lo*****@nospam .nospamschreef in bericht
news:Os**** **********@TK2M SFTNGP03.phx.gb l...
>>A bit of WndProc overriding should do the trick:
>http://groups.google.com/group/micro...fbdea8e5?hl=sv
>>
> /claes
>>
>"rb" <rb*****@comcas t.netwrote in message
>news:B9*** *************** ************@co mcast.com...
>>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.
>>>
>>rb
>>>
>>
>>
>
>




Aug 3 '06 #8
Remove that line. Not sure why you put it in there. The code in the link I
sent you has a complete class with all the stuff needed. Change your
lstPartijen to be an instance of that class (i.e ListViewEx).

/claes

"JR" <x.*@x.x.wrot e in message
news:Kd******** *********@phobo s.telenet-ops.be...
that is the line: Me.lstPartijen. WndProc = &H4E

the error is a blue underline in the vb editor

Private Sub FrmRonde_Load(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
Me.lstPartijen. WndProc = &H4E

End Sub

where lstpartijen is mij listview. It has 3 columns. I don't want them to
change the size. the column headers are Nonclickable
How must a do it. Can you give me some extra code, how to set each column
not to change? The class has no underline/error

Jan
"Claes Bergefall" <lo*****@nospam .nospamschreef in bericht
news:eg******** ******@TK2MSFTN GP06.phx.gbl...
>No that's fine.

You say you get an error on the line Me.lstPartijen. WndProc = &H4E. Where
does that line come from? Show your code

/claes
"JR" <x.*@x.x.wrot e in message
news:0B******* *************** *@phobos.telene t-ops.be...
>>Yes. I copyed into a new class module.

Must I place it somewhere else?

Jan
"Claes Bergefall" <lo*****@nospam .nospamschreef in bericht
news:OW****** ********@TK2MSF TNGP03.phx.gbl. ..
That line doesn't make any sense. WndProc is a protected method. You
can't assign anything to it.

You need to use an inherited ListView. Did you copy the code in the
link I posted?

/claes

"JR" <x.*@x.x.wrot e in message
news:5D***** *************** **@phobos.telen et-ops.be...
sorry wrong message.
I get the messageon line Me.lstPartijen. WndProc = &H4E. Is not
accessebl e becouse it is protected
>
Jan
>
>
>
"JR" <x.*@x.x.schree f in bericht
news:Wv**** *************** ****@phobos.tel enet-ops.be...
>>I don't get an error when I import this code in 2003 so I think it
>>must work also in 2003.
>>
>I get the message : Me.lstPartijen. WndProc = &H4E
>>
>>
>Jan
>>
>>
>How do I override the listviews property
>"Claes Bergefall" <lo*****@nospam .nospamschreef in bericht
>news:Os*** ***********@TK2 MSFTNGP03.phx.g bl...
>>>A bit of WndProc overriding should do the trick:
>>http://groups.google.com/group/micro...fbdea8e5?hl=sv
>>>
>> /claes
>>>
>>"rb" <rb*****@comcas t.netwrote in message
>>news:B9** *************** *************@c omcast.com...
>>>Hi All,
>>>>
>>>Is there a property or method to keep the headercolumns from being
>>>resize d by the user
>>>for a listview?
>>>>
>>>I am using Visual Basic in Visual Studio . net 2005
>>>>
>>>Thank you.
>>>>
>>>rb
>>>>
>>>
>>>
>>
>>
>
>




Aug 3 '06 #9
JR
Thanks,

Now I think that I understand.
Is this the same as a usercontrol?

Jan
"Claes Bergefall" <lo*****@nospam .nospamschreef in bericht
news:uh******** ******@TK2MSFTN GP06.phx.gbl...
Remove that line. Not sure why you put it in there. The code in the link I
sent you has a complete class with all the stuff needed. Change your
lstPartijen to be an instance of that class (i.e ListViewEx).

/claes

"JR" <x.*@x.x.wrot e in message
news:Kd******** *********@phobo s.telenet-ops.be...
>that is the line: Me.lstPartijen. WndProc = &H4E

the error is a blue underline in the vb editor

Private Sub FrmRonde_Load(B yVal sender As System.Object, ByVal e As
System.EventAr gs) Handles MyBase.Load
Me.lstPartijen .WndProc = &H4E

End Sub

where lstpartijen is mij listview. It has 3 columns. I don't want them to
change the size. the column headers are Nonclickable
How must a do it. Can you give me some extra code, how to set each column
not to change? The class has no underline/error

Jan
"Claes Bergefall" <lo*****@nospam .nospamschreef in bericht
news:eg******* *******@TK2MSFT NGP06.phx.gbl.. .
>>No that's fine.

You say you get an error on the line Me.lstPartijen. WndProc = &H4E.
Where does that line come from? Show your code

/claes
"JR" <x.*@x.x.wrot e in message
news:0B****** *************** **@phobos.telen et-ops.be...
Yes. I copyed into a new class module.

Must I place it somewhere else?

Jan
"Claes Bergefall" <lo*****@nospam .nospamschreef in bericht
news:OW***** *********@TK2MS FTNGP03.phx.gbl ...
That line doesn't make any sense. WndProc is a protected method. You
can't assign anything to it.
>
You need to use an inherited ListView. Did you copy the code in the
link I posted?
>
/claes
>
"JR" <x.*@x.x.wrot e in message
news:5D**** *************** ***@phobos.tele net-ops.be...
>sorry wrong message.
>I get the messageon line Me.lstPartijen. WndProc = &H4E. Is not
>accesseb le becouse it is protected
>>
>Jan
>>
>>
>>
>"JR" <x.*@x.x.schree f in bericht
>news:Wv*** *************** *****@phobos.te lenet-ops.be...
>>>I don't get an error when I import this code in 2003 so I think it
>>>must work also in 2003.
>>>
>>I get the message : Me.lstPartijen. WndProc = &H4E
>>>
>>>
>>Jan
>>>
>>>
>>How do I override the listviews property
>>"Claes Bergefall" <lo*****@nospam .nospamschreef in bericht
>>news:Os** ************@TK 2MSFTNGP03.phx. gbl...
>>>>A bit of WndProc overriding should do the trick:
>>>http://groups.google.com/group/micro...fbdea8e5?hl=sv
>>>>
>>> /claes
>>>>
>>>"rb" <rb*****@comcas t.netwrote in message
>>>news:B9* *************** **************@ comcast.com...
>>>>Hi All,
>>>>>
>>>>Is there a property or method to keep the headercolumns from being
>>>>resiz ed by the user
>>>>for a listview?
>>>>>
>>>>I am using Visual Basic in Visual Studio . net 2005
>>>>>
>>>>Thank you.
>>>>>
>>>>rb
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>




Aug 3 '06 #10

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

Similar topics

15
3863
by: Wiktor Zychla | last post by:
today we've found a critical issue regarding the ListView from Windows.Forms. it was confirmed on several machines with Win2K and XP. here's the problem: create a ListView with about 50000 rows. now use task manager to see the GDI usage of the process. everything seems normal. now catch the ListView's scroller and start to move it downwards. you have to hold the constant speed so that the ListView is constantly repainted. look at the...
2
2289
by: Sagaert Johan | last post by:
Hi I have set the columreorder to true Is there a way to get/set the current columnorder, so i can restore the order from a saved setting ? Johan
6
2529
by: Vanessa | last post by:
With this program I can do one selection, but upon the second I get an error where ///////////////// is indicated. Please help. using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data;
4
9704
by: Paddy | last post by:
How do I select a subitem from a listview after clicking on the first column? Couldn't find it in MSDN. Thank you. Paddy.
0
4473
by: Zac Maclean | last post by:
I have a working version of this in VB, tryign to translate everything over to C#. In the C# version this is filling the listview, the first couple columns are ok, but the last few are going screwy. In VB, it is working perfectly. The reason for move is speed. Takes a full 10 - 15 seconds to run this on VB, <5 in C#. I adapted this from
12
5402
by: Mike Smith | last post by:
Hey anyone knows how to find an item in a list view based on text ? Cant seem to get the IndexOf method working. would the LVM_FINDITEM method using SendMessage API work in .Net ?
21
5199
by: StriderBob | last post by:
Situation : FormX is mdi child form containing 2 ListViews ListView1 contains a list of table names and 4 sub items with data about each table. ListView2 contains a list of the columns on each table and 11 sub items with data about each column. When a Row in ListView1 is selected the Data in ListVies2 is loaded to show the correct data. Initially the first row in ListView1 is selected in FormX load
12
7474
by: J L | last post by:
When I fill a listview, I resize the columns to fit the data. I need to know if the data will fit vertically or if there will be a vertical scroll bar. I need to know this so I can allow for it on the overall size of the listview. My question therefore is, how can I tell if the items I have added will fit in the listview at its given height? A secondary one, just for interest sake...is there a way to determine the exact heght needed...
0
1628
by: Brian Henry | last post by:
Ok whats going on here... got a couple problems... this is relevant now to this group since .NET 2.0 is finally RTM 1) draws really slow when making it a large form (resizing speed is jerky) to a res from 100x100 to 1280x1024 once it gets above 500x500 it starts jerking you can see the screen refreshing as it paints 2) sometimes the background selection when you select multiple items then move the mouse around on the screen dissapear...
2
2195
by: justdo | last post by:
Hi, I am writing the unit test for our application. It use "listview component" in some functions. The following code work fine and get c = 1 in Windows Application mode, but fail in unit test which get c = 0 : listView2.Items.Add("xxx"); listView2.Items.Selected = true; int c = listView2.SelectedItems.Count; in unit test, we create listView2 by this way:
0
8444
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
8356
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8869
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
8551
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
7386
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
6198
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
4198
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
4368
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2771
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.