ListView Control

  • Thread starter Thread starter Hannes
  • Start date Start date
H

Hannes

Hi,

I'd like to align the content of a list view control to "center". The
list view control now contains 6 large icons in two columns. The whole
list view control is currenlty left aligned. How can I manage to have
the whole list view control (including all icons) to be centered on
the screen. Any hint?

Thanks
Hannes
 
You can only set alignment when displaying items in report (details) view.
If you want your icons equally distributed across the screen you'll need to
calculate the ideal spacing based on the icon size and width of the control
and number of "columns". You can't set this directly on the ListView control
but you must use some interop and send a LVM_SETICONSPACING message to the
control. You can refer to the SDK documentation for this message to see how
the parameters are handled. You can use
Microsoft.WindowsCE.Forms.MessageWindow to send the message using the Handle
property of your ListView control as the target.

Peter

--
Peter Foot
Microsoft Device Application Development MVP
peterfoot.net | appamundi.com | inthehand.com
APPA Mundi Ltd - Software Solutions for a Mobile World
In The Hand Ltd - .NET Components for Mobility
 
You can only set alignment when displaying items in report (details) view.
If you want your icons equally distributed across the screen you'll need to
calculate the ideal spacing based on the icon size and width of the control
and number of "columns". You can't set this directly on the ListView control
but you must use some interop and send a LVM_SETICONSPACING message to the
control. You can refer to the SDK documentation for this message to see how
the parameters are handled. You can use
Microsoft.WindowsCE.Forms.MessageWindow to send the message using the Handle
property of your ListView control as the target.

Peter

--
Peter Foot
Microsoft Device Application Development MVP
peterfoot.net | appamundi.com | inthehand.com
APPA Mundi Ltd - Software Solutions for a Mobile World
In The Hand Ltd - .NET Components for Mobility

Do you know of any professional control libraries which could handle
this automatically? Any recommendations ( I know of resco, but are
there better further ones)

Thanks for your response
 
Back
Top