Windows Mobile 5 SDK Button Control

2020-04-12 12:27发布

问题:

I'm a fairly novice programmer working on my first Windows Mobile application. I see that there is no button control available for my program. I've never created a custom control before, and I understand that is the only way that I can get a button for my application (it is a requirement as per my client). I was wondering if someone could give me a quick walk through on how I would create this. I'm using Visual Studio 2005 with the Windows Mobile 5 SDK, creating an application that is to be deployed on non-touchscreen devices.

Thank you in advance for any help you can provide.

Update: A button control is a better option for this project, due to the amount of data that needs to be manipulated quickly. There are seven sections with a counter label, and next to each label is a set of three buttons. One button increases the int on the label, anther decreases it, and the third lets the user input an int value to assign to the label. I tried developing a menu system to control all this, but the menu ended up being nested too deep, and quick access to making a change is important.

I figured out how to make a very basic button by creating a user control, now I am having issues making the label on the control changeable in the properties window.

回答1:

You are obviously developing with the Smartphone SDK, where no button is available. If you'd use the PocketPC SDK, then you'd have a button. These SDKs have been renamed to Standard and Professional alternatively in Windows Mobile 6.

To be honest, I wouldn't recommend using a button in a Smartphone application. You could explain to your client that it is against the Windows Mobile guidelines to use a button in Smartphone applications and that the menu should be used instead. This is much quicker than having to navigate to the button and then clicking it.

If the client insists on it, create a class that inherits from the Control class and override the OnPaint event.



回答2:

There is most definitely a button control available - no need to write your own. The controls available to you will be in the toolbox, which should be docked on the left side of Visual Studio. The controls won't be visible there unless you've added a form to your project and you have the form selected.



回答3:

I faced the same problem, there's no Button control on Device controls toolbox in Visual Studio 2008. I know that it's because guidelines tell us to use links and menu instead.

But you know, sometimes you must put a button when user requires it.

I'm giving a try to the SDKs for Windows Mobile 6 at

http://www.microsoft.com/downloads/details.aspx?FamilyID=06111a3a-a651-4745-88ef-3d48091a390b&displaylang=en

but wondering where can I find a Windows Mobile 6.5 SDK?