News | Articles | Libraries | Developer Tools | Books | Forum Links | Search   
Sections:
 

QA: How to create a spin control like in Microsoft programs?

By Vassili Philippov, November 26, 2003.
Print version

Question

In standard Pocket PC applications spin control has special Pocket PC look and feel. How can I create the same looking spin control?

Answer

If you create a spin control and attach it to an edit box it will look like:

But in standard Pocket PC applications it looks like:

which is much better for Pocket PC.

Two accomplish the same style you should make two things. First you should change spin orientation from vertical to horizontal:

After that your spin control will look like:

The second you should send CCM_SETVERSION message to the spin control with wParam=COMCTL32_VERSION. You can do it for example in WM_INITDIALOG message handler:

::SendDlgItemMessage(m_hWnd, IDC_SPIN1, CCM_SETVERSION, COMCTL32_VERSION, 0);

That's all. Now your spin control has standard (but undocumented) look and feel:

Related resources:

Discuss

Discuss this article. Here you can write your comments and read comments of other developers.
Rate this article:     Poor Excellent    
 12345 
© 2001-2005 Pocket PC Developer Network, a division of Spb Software House