473,402 Members | 2,053 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,402 software developers and data experts.

How do we change the StringTrimming of listview?

Tee
Hi,

I have a listview control that has a column displaying path.
I need to change the StringTrimming of text in this column to
StringTrimming.EllipsisPath, but there is no paint event available for
ListView control, anyone know how can I achieve that?
Thanks,
Tee

Nov 16 '05 #1
3 1420
Have you tried creating a sub that handles the paint event...I thought every
control had a paint event. If this doesn't work for ListView, you can
subclass it and use the "OnPaint" protected method which is called before the
listview is repainted.

"Tee" wrote:
Hi,

I have a listview control that has a column displaying path.
I need to change the StringTrimming of text in this column to
StringTrimming.EllipsisPath, but there is no paint event available for
ListView control, anyone know how can I achieve that?
Thanks,
Tee

Nov 16 '05 #2
Tee
The bad news is there is no paint event for ListView.
According to
http://www.codeproject.com/cs/miscct...paintevent.asp, ListView
and TreeView in .NET 1.x are just wrapper around the controls in ComCtl.

"Dennis" <De****@discussions.microsoft.com> wrote in message
news:D0**********************************@microsof t.com...
Have you tried creating a sub that handles the paint event...I thought every control had a paint event. If this doesn't work for ListView, you can
subclass it and use the "OnPaint" protected method which is called before the listview is repainted.

"Tee" wrote:
Hi,

I have a listview control that has a column displaying path.
I need to change the StringTrimming of text in this column to
StringTrimming.EllipsisPath, but there is no paint event available for
ListView control, anyone know how can I achieve that?
Thanks,
Tee

Nov 16 '05 #3
It does have an OnPaint Method ...at least it's shown in the ListView Class
Members on MSDN. You can subclass the ListView and then handle your work in
an override of the OnPaint Method?

"Tee" wrote:
The bad news is there is no paint event for ListView.
According to
http://www.codeproject.com/cs/miscct...paintevent.asp, ListView
and TreeView in .NET 1.x are just wrapper around the controls in ComCtl.

"Dennis" <De****@discussions.microsoft.com> wrote in message
news:D0**********************************@microsof t.com...
Have you tried creating a sub that handles the paint event...I thought

every
control had a paint event. If this doesn't work for ListView, you can
subclass it and use the "OnPaint" protected method which is called before

the
listview is repainted.

"Tee" wrote:
Hi,

I have a listview control that has a column displaying path.
I need to change the StringTrimming of text in this column to
StringTrimming.EllipsisPath, but there is no paint event available for
ListView control, anyone know how can I achieve that?
Thanks,
Tee


Nov 17 '05 #4

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

Similar topics

0
by: MikeMechanics | last post by:
Hello I'm a C# beginner and I want to use the ListView Control in Detail view. Now I have a couple of questions The first column of my listview should have a fixed size and the last column...
6
by: Tee | last post by:
Hi, I have a listview control that has a column displaying path. I need to change the StringTrimming of text in this column to StringTrimming.EllipsisPath, but there is no paint event available...
0
by: Willie wjb | last post by:
Hi, when drawing text onto a form i want to draw it where the text is trimmed by character base. however when using the code below the text is drawn as trimmed by word. Only the last items that...
0
by: CR | last post by:
I'm having a problem with the Listview control. I populated a Listview with 4 columns. On my PC they show up just fine, the right hand edge of the 4th column lines up with the right hand edge of...
1
by: LagartijaNick | last post by:
Question: I have a ListView in which I'm selecting a ListViewItem based on the value of a textbox. On my XP machine (with default color scheme) the ..Selected row is a noticable grey (back color...
0
by: Brian Keating | last post by:
Hi there, I'm trying to draw a string in a listview. However when i set the StringTrimming to None, it trims to a word! I think this is a bug because there is StringTrimming.Word option too and...
2
by: Pucca | last post by:
I'm doing like a directory view thing with a TreeView on panel1 and Listview control on panel2 of a splitcontainer. I have 2 quesiton: 1. How do I make the splitcontainer and the TreeView and the...
3
by: bthetford | last post by:
I have a ListView with 4 columns that shows in details mode. How do I change the text of one of the columns of a specific item if I know the index I want to change at? mylistview.Items.Tag...
5
by: Jure Bogataj | last post by:
Hi all! I have a problem (performance issue) with listview. I have implemented an ItemSelectionChange on my listview and put some code in it (I build some toolbar based on selection and update...
1
by: Tom P. | last post by:
I am doing some special painting in a listview control. I have gotten the drawing of the string to cut off and ellipse correctly in XP but in Vista the cutoff and ellipse never happen. I know it's...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
0
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,...
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...
0
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...
0
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,...

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.