views:

27

answers:

1

I'm developing a Windows Mobile application in C# using .NET Compact Framework 3.5. My target version of WM is 6.5.x. It was my impression that Microsoft has updated the stock controls in this release of the OS to be more finger friendly (larger fonts, greater space between rows in listboxes, etc.) but when I create, for example, a ListBox-control, it looks the same as it did in the previous versions of the OS (stylus friendly).

Do I need to update the style of the controls in order to take advantage of these new finger friendly stock controls? I can't seem to find any documentation on this, however. Or have I misunderstood it; perhaps there are no new controls in WM 6.5.x?

+1  A: 

You can get the "new" list view item rendering by sending the list view a LVM_SETEXTENDEDLISTVIEWSTYLE message with both mask and style set to LVS_EX_THEME:

var mask = (IntPtr)LVS_EX_THEME;
var style = (IntPtr)LVS_EX_THEME;

SendMessage(this.listView.Handle, LVM_SETEXTENDEDLISTVIEWSTYLE, mask, style);

You'll need these declarations in one way or another:

[DllImport("coredll.dll", SetLastError = true)]
public static extern Int32 SendMessage(IntPtr hWnd,
                                       Int32 msg,
                                       IntPtr wParam,
                                       IntPtr lParam);

public const Int32
    LVM_FIRST = 0x1000,
    LVM_SETEXTENDEDLISTVIEWSTYLE = LVM_FIRST + 54;

public const Int32
    LVS_EX_THEME = 0x02000000;
Johann Gerell
Thank Johann, that works (I guess; haven't tested it) for listview controls. What about other controls, such as listboxes?
vonolsson
@vonolsson: My guess is that the "plain old" Win32 controls, like listbox, will not get much of a face-lift by Microsoft.
Johann Gerell
There are listboxes (checkout Settings -> Today for an example) that are more finger friendly in 6.5.x. Futhermore, there's the new horizontal scroll control (as opposed to using the old tab control) that I would like to be able to use.
vonolsson
@vonolsson: If you look at the 6.5.3 docs for PROPSHEETHEADER, you'll see PSH_PIVOT. It's a private style defined as 0x4000 in commctrl_priv.h if Platform Builder for WM is installed.
Johann Gerell