Data Access Worldwide Knowledge Base

Article ID 2295
Article Title HOWTO: Create a spinform with a step by value
Article URL http://www.dataaccess.com/kbasepublic/KBPrint.asp?ArticleID=2295
KBase Category VDF12
Date Created 01/27/2007
Last Edit Date 09/20/2007


Article Text
QUESTION:
I have a dbSpinForm.
In that I have Set following properties:

         Set Maximum_Position to 1800
         Set Minimum_Position to 800
         Set Wrap_State to True

If I clicked on the spin button, value is incremented / decremented the value 1.
But I want to to increment / decrement it by 10.
How can I do it?

ANSWER:
The VDF class does not have a standard (built-in function) available, but there is a Windows function that we can use. It is called "setting the acceleration". You can set the acceleration that takes place after N seconds. So if you hold down the up/down button it will increment/decrement by the set value after N seconds holding. The window message is called UDM_SETACCEL (see http://msdn2.microsoft.com/en-us/library/ms649988.aspx)

Besides the Windows feature, we also have to intercept the key_up and key_down. This is done in the standard spinform class and increments or decrements by one.

The enclosed example view shows how to use the enhanced spinform control. While the example uses SpinForm and not dbSpinForm, we can add the same functionality with the dbSpinForm subclass.


Contributed By:
Vincent Oorsprong
Company: Data Access Worldwide
email: vincent.oorsprong@dataaccess.eu
Web Site: http://www.dataaccess.eu

Web Links Related to this Article
File SpinForm.zip
URL=http://www.dataaccess.com/KBasePublic/Files/2295.SpinForm.zip

MSDN Library - UDM_SETACCEL Message
URL=http://msdn2.microsoft.com/en-us/library/ms649988.aspx


Email this Article
Email this Article to a Colleague
Send Feedback on this Article to Data Access Worldwide
Copyright ©2010 Data Access Corporation. All rights reserved.

The information provided in the Data Access Technical Knowledge Base is provided "as is" without warranty of any kind. Data Access Corporation disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. In no event shall Data Access Corporation or its suppliers be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages, even if Data Access Corporation or its suppliers have been advised of the possibility of such damages. Some states do not allow the exclusion or limitation of liability for consequential or incidental damages so the foregoing limitation may not apply.