Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) Post any question regarding Basic4ppc.

NumUpDown control

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-28-2007, 07:39 PM
Junior Member
 
Join Date: Apr 2007
Location: Cornwall UK
Posts: 38
Send a message via Skype™ to davelew1s
Default NumUpDown control

Hi!
Can the NumUpDown control be used to increment and display numbers with a decimal point? I've had a play but nothing is obvious ...any ideas?
Dave Lewis.
Reply With Quote
  #2 (permalink)  
Old 07-28-2007, 07:49 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 2,344
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Staright answer....NO

BUT you can use a combination of num control to create a decimal number...
like one to the hole number, one to 1/10ths and one th the 1/100... then combine the results

a=num1.value &","& num2.value & num3.value
suposing that the min is set to 0 and max to 9

If num1 = 5 and num2=4 and num3 = 2
a=5,42
__________________
Paulo Gomes - Porto, Portugal - Living/Working in France
Mobile Device: Samsung Galaxy S, Android 2.3.4 CUstom ROM
Laptop: Toshiba NB100-130 (running on Win7Ultimate)

My Posts helped you? Consider Buying me a Porto Glass!
Reply With Quote
  #3 (permalink)  
Old 07-28-2007, 08:37 PM
Basic4ppc Veteran
 
Join Date: Apr 2007
Posts: 269
Default

See also the code in this example, not yet finished under the control UNITS.
Marc
Attached Files
File Type: sbp $PRNG.sbp (9.5 KB, 18 views)
Reply With Quote
  #4 (permalink)  
Old 07-29-2007, 03:14 PM
RandomCoder's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Location: Derbyshire, UK
Posts: 623
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Here's a simple solution, I offered to someone in the old forum who wanted to increment in Tens...

Just overlay a TextBox over the NumUpDown control, now you can display in whatever units you want, you could even add a symbol if needed.

Attached is an example that counts in 0.1 increments, bet you can't spot any difference in operation to a normal NumUpDown control

Regards,
RandomCoder
Attached Files
File Type: sbp Decimal NumUpDown.sbp (461 Bytes, 25 views)
__________________
"Defeat never comes to any man until he admits it."Josephus Daniels
Reply With Quote
  #5 (permalink)  
Old 07-29-2007, 05:29 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Quote:
Originally Posted by RandomCoder View Post
bet you can't spot any difference in operation to a normal NumUpDown control
Well the text is grey and doesn't match other controls' text because the Textbox needs to be disabled and this automatically greys the text.

To REALLY make it look like a normal UpDown control leave the Textbox enabled and use a GotFocus event procedure to prevent user entry.
Code:
Sub TextBox1_GotFocus
    Num1.Focus
End Sub
EDIT: Erel, if you read this, why do I get two GotFocus events in this situation? Without the Num1.Focus I get the single event I expect, if I call the .Focus method on any other control I get called twice!

Last edited by agraham : 07-29-2007 at 06:07 PM.
Reply With Quote
  #6 (permalink)  
Old 07-29-2007, 07:25 PM
Junior Member
 
Join Date: Apr 2007
Location: Cornwall UK
Posts: 38
Send a message via Skype™ to davelew1s
Default

Hi!
Thanks for the replies, Randomcoder your solution works find for me the fact that it's greyed out is a bonus.
Dave.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
NumUpDown skipper Questions (Windows Mobile) 2 02-13-2008 03:19 PM
NumUpDown anomaly agraham Bug Reports 1 07-30-2007 03:57 PM
Wrong numUpDown control during design on the device specci48 Bug Reports 0 05-20-2007 07:24 AM
NumUpDown petrbury Bug Reports 6 05-15-2007 04:55 PM


All times are GMT. The time now is 10:55 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0