|
-
April 28th, 2008, 04:45 AM
#1
lsitview with autosize
Hi! I've seen very few exampels on sizing the listview columns. While im adding file and dir paths to it, it automaticly gets cropped, which is kind of anoying. I dont know WHY ms diddnt included a option for length and dif length from row to row, but is there an easy way to solve this problem? I found one example in c++ and it diddnt make much sense to me.
Any suggeston or help is very much appriciated.
-pix
-
April 28th, 2008, 05:07 AM
#2
Re: lsitview with autosize
Just to be clear, you want the listview to automatically adjust its width to show a string in its entire length rather than showing a horizontal scrollbar?
EDIT: Seems I confused the ListView with the ListBox ... well, it happens
Last edited by foamy; April 28th, 2008 at 05:12 AM.
It's not a bug, it's a feature!
-
April 28th, 2008, 08:14 AM
#3
Re: lsitview with autosize
 Originally Posted by cpix
Hi! I've seen very few exampels on sizing the listview columns. While im adding file and dir paths to it, it automaticly gets cropped, which is kind of anoying. I dont know WHY ms diddnt included a option for length and dif length from row to row, but is there an easy way to solve this problem? I found one example in c++ and it diddnt make much sense to me.
Any suggeston or help is very much appriciated.
-pix
You can always add a length to the column of a listview..
Code:
int colLength = 500;
listview1.Columns.Add(L"Column Name", colLength);
Last edited by somu0915; April 28th, 2008 at 08:18 AM.
-
April 30th, 2008, 04:34 AM
#4
Re: lsitview with autosize
seems i was bit unclear The problem im having is that I got a listview
which is getting files and folder paths. Problem is, when i Drop a item to the listview the string gets cropped like this somefi~1.txt, it's not the listview that makes this problem, seems more like the drag from the folderview control (tested with others as well), so there must be some the way i retrive the data from the control im dragging from..
private void ListView1_ItemDrag_1(object sender, System.Windows.Forms.ItemDragEventArgs e)
{
DoDragDrop(e.Item, DragDropEffects.Move);
}
private void ListView1_DragEnter_1(object sender,
System.Windows.Forms.DragEventArgs e)
{
e.Effect = DragDropEffects.Copy;
}
and then finally:
===========
FileName = ((string[])(e.Data.GetData("FileName")))[0];
lbltest.Text = FileName;
lvBackupFiles.Items.Add(FileName);
=======
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|