From: Hannes on
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
From: Peter Foot on
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

"Hannes" <heckner(a)gmx.net> wrote in message
news:ab97a080-9750-41e2-bff6-a2d271038938(a)e53g2000hsa.googlegroups.com...
> 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

From: Hannes on
On 4 Jul., 17:20, "Peter Foot" <feedb...(a)nospam-inthehand.com> wrote:
> 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
>
> "Hannes" <heck...(a)gmx.net> wrote in message
>
> news:ab97a080-9750-41e2-bff6-a2d271038938(a)e53g2000hsa.googlegroups.com...
>
> > 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

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