DEVBUZZ Homepage Pocket PC - Color Button Control
 
Web www.devbuzz.com
  HOME PAGE
  All Articles
  Advertise
  Consulting

 Development
  Discuss - Forums
  Still in the box?
  .Compact Framework
  Code Snippets
  SQL Server CE
  Database
  MS Resources
 Stores
  Developer Controls
  Pocket PC Hardware
  Pocket PC Software
  Pocket PC Books
  .NET CF Books
  Book Reviews
  SPB SW Discounts
  RESCO SW Discounts
 DEVBUZZ Info
  About Us
  Help
  Join our email list
  Links & Ratings
  Press & Comments
  Pocket PC version
  Software Reviews
  Hardware Reviews
 Authors
  Authors
  Article Guide
  Competitions
 Resources
  Developers
  Register
  Login

  SPB Discounts!
 Columnists
  Rick Winscot
 Past Blast
  Personal Media Ctr
  Gizmobility
  eVB Legacy
  Old news
  Hosted Software
  Wireless
  Newsletters
  Carl Davis
  Upton Au

 Pocket PC Registry
  Join the registry
  View current list
 Current Poll
Are you converting to .NET Compact Framework?
Yes, it has changed my life!
No, I'm sticking with eVB
.NET CF what's that`?

Current results
3431 votes so far
 Recent Forum Threads [goto forums]

Get Computername
read... (67 hits)


Great aid to development productivity
read... (82 hits)


ThreadingTimer sample code
read... (143 hits)


Multithreading with .NET CF
read... (194 hits)


Moving from eMbedded Visual Basic to Visual Basic .NET
read... (166 hits)


.NET Compact Framework 2.0 Service Pack 2
read... (226 hits)


Transfer Data from SQL Server 2000 to SQL Server Compact Edition
read... (298 hits)


This protocol version is not supported
read... (236 hits)


Converting Lowercase to uppercase wont work
read... (203 hits)


Direct access to MS SQL Server 2000
read... (374 hits)


Creating SDF file in Desktop
read... (513 hits)


Winsock in CF.NET
read... (316 hits)


Using Pocket Outlook to submit HTML page form with MAILTO action
read... (420 hits)


Missing file "System.Data.PocketPC.asmmeta.dll"
read... (268 hits)


HP iPAQ hw6915 Serial Port Issue
read... (309 hits)


Info on the recent forum changes
read... (341 hits)


SqlServer tools from Redgate
read... (383 hits)


Arrow keys and Hardware navigation button
read... (393 hits)


O2 XDA lls pin sync cable to comport
read... (322 hits)


Creating dynamic folders on Pocket PC OS
read... (299 hits)

Custom Windows Mobile software development.
LBS Challenge 2007
LBS Challenge Eight previous NAVTEQ Global LBS Challenge® participants have received venture capital funding and nine past LBS Challenge winners have launched commercial applications on major wireless carriers. Register your non-commercial LBS application in the 2007 NAVTEQ Global LBS Challenge in one of three regions: Americas, Europe-Middle East-Africa (EMEA) or Asia-Pacific(APAC). You could win a share of $2 million in prizes. This could be your year.
Dream. Develop. Win.

Development | .NET Compact Framework

Pocket PC - Color Button Control
Written by Derek Mitchell  [author's bio]  [read 7274 times]
Edited by Derek

.NET Compact Framework   

Page 1 

Color Button Control

This article will help you get up and running with the Color Button Control we sell in the DEVBUZZ Store. For a limited time we have the Color Button Control in our store for $9.95. It's incredibly easy to use, comes with full Visual Studio design-time support and will make your Pocket PC applications much more attractive.

Getting started...

First install the Color Button Control. (Color Button Installation Instructions are available here)

Next create a new Visual Basic project for Smart Device Application project.

Once you have added the Color Button control to your toolbox, as shown in the image below,

Color Button Control for the Pocket PC

drag the Color Button control onto a form and position it where you need it to be. You can also use code to add and position the button if needed.

Device controls for Pocket PC developers

Now we are ready to begin setting the properties of this button. For the purposes of this exercise, let's use one of the ready-made button image sets which can be found in the ColorButton\ColorButton.Graphics\Buttons directory.

Click on the Color Button control on your form and then click on the properties tab shown in the image above.

The BackColor property specifies the color of the button - in this case "gray". The BackDownColor property specifies the color of the button when it is "pressed" (down) or clicked.

The ForeColor property specifies the color of the text when the color button control is in its rest state. The ForeDownColor property specifies the color of the text when the color button control is in its "down" or clicked state.

ColorButton_ImageUpIn this exercise, we are going to use ImageDown and the ImageUp properties. The ImageDown property specifies the image (of type System.Drawing.Bitmap) that the button will look like when it is clicked. The ImageUp property specifies what the color button will look like when it is not being clicked, or in other words, when it is "up".

Click on the ImageDown property and navigate to the ColorButton\ColorButton.Graphics\Buttons directory.

Color Button file directories

Select the 7-1.gif file you will find there. Click Open to return to the Properties tab.

Color Button images for Pocket PC developers

Click on the ImageUp property and navigate to the ColorButton\ColorButton.Graphics\Buttons directory. Select the image file 7-2.gif. Once both properties have been specified the color button control will change color to reflect the image file you have chosen.

Color Button Image properties for Pocket PC developers

If you wish to change the text on your button click on the 'Text' property and enter the text you wish to see on your button.

One of the really neat aspects of the color button control is the ability to add an icon to your color button. You can either roll your own or choose an icon from the list of icons that comes bundled with the Color Button control found in the ColorButton\ColorButton.Graphics\Icons directory.

Change the text on the ColorButton1 color button to 'Print'. Now lets add an icon to our 'Print' button. In the properties tab click on icon and navigate to the icons directory and select the icon named 'icon_0008.ico'. Click 'Ok' to return to the Properties tab.

To indent the icon from the left edge of the button, simply increase the default 'IconMargin' property accordingly. For our exercise we will set the 'IconMargin' property to 6. To move the text on the button closer or further from the icon, increase or decrease the 'IconTextSpace' property according to the distance you want to see between the icon and the text. For our exercise set the 'IconTextSpace' property to 5.

Here is an avi animation demonstrating the button responding up/down events. Right click and choose 'Save As' - about 300kb. For a more detailed avi animation showing how easy the Color Button Control is to use download this file - about 2.5 MB.

Pocket PC controls

 

Pocket PC controls

 

Don't forget to check the DEVBUZZ forums for additional information.

Back to .NET Compact Framework | [Article Index]

 

Back to the top of the page.
Franson GPS tools for the Pocket PC Chris De Herrera's Windows CE Website Windows CE News & Information Source RESCO Software discounts
Copyright ©2000-2008 by DEVBUZZ.COM, Inc., TX. USA.