ListView font and icon spacing

B

bonkers

Working in VB.Net 2003....

Got a ListView showing 10 images from an ImageList. Each item has Text, too.

Problem: When I try to use a larger size image, the images start overlapping
one another, as well as overlapping the text.

Is there a way to set the distance between the Icons in the ListView (I'm
using LargeIcon view)?

I've set the font to a smaller size -- which is tricky, but can be done --
but that "shrinks" the icons. AND if I then go back and re-set the image
size, VB deletes the line I wrote that sets the font....
 
E

Elisa

Hi,

Look for a previous thread about ListView icon spacing, it'll contain
some code you could try. Sadly, the code doesn't seem to work in all
circumstances :-(

Also, I now try to stick to 32x32 sized images, other sizes indeed give
odd results, although that might only occur if you use multilple
ImageLists throughout your application, where each ImageList has
different image sizes.

Again, ListViews and ImageLists are extremely "fragile" in the current
..NET CF framework. You might want to create your own simplistic
"ListView", i.e. a panel with a Collection of images and an Up and Down
button, for example.


Regards,

Elisa
 
R

Rissa

Elisa;

I found your earlier post...

To change the width of your column, you need to get into the column
collection and set its width. You can make the column width less than, equal
to, or greater than the width of the ListView, and watch the results. Even
if you're not using the "Details" view, this setting affects your horizontal
scrollbar. (...talk to the hand)

I'm working in VB, so I don't have the exact same settings as in C#... I'm
going to look for an equivalent to Alex's "setIconSpacing"

By the way, Is there a way to search in this newsgroup on earlier dates than
when you first subscribed to it? I had to go to DevEx to search for your
earlier post.

--Rissa
 
E

Elisa

Hi,
To change the width of your column, you need to get into the column
collection and set its width. You can make the column width less than, equal
to, or greater than the width of the ListView, and watch the results. Even
if you're not using the "Details" view, this setting affects your horizontal
scrollbar. (...talk to the hand)

I'll definetly give that a try tomorrow!
I'm working in VB, so I don't have the exact same settings as in C#... I'm
going to look for an equivalent to Alex's "setIconSpacing"

' Sadly, this doesn't seem to work...
mLVIcons.Capture = True
Dim hWnd As IntPtr = GetCapture()
mLVIcons.Capture = False
SendMessage(hWnd, Convert.ToUInt32(&H1035), Convert.ToUInt32(0), (36 <<
16) Or (36 And &HFFFF))

<DllImport("coredll", SetLastError:=True)> _
Private Shared Function GetCapture() As IntPtr
End Function

<DllImport("coredll", SetLastError:=True)> _
Private Shared Function SendMessage(ByVal hWnd As IntPtr, ByVal msg As
UInt32, ByVal wParam As UInt32, ByVal lParam As Integer) As IntPtr
End Function
By the way, Is there a way to search in this newsgroup on earlier dates than
when you first subscribed to it?

The whole newsgroup is archived on groups.google.com (add
group:*.compactframework to your search query).


Regards,

Elisa
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top