Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


NumUpDown control


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-28-2007, 08:39 PM
Junior Member
 
Join Date: Apr 2007
Location: Cornwall UK
Posts: 22
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, 08:49 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 1,313
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

PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD
PPC: Qtek9000, 1GB SD

DLL Version Listing
Reply With Quote
  #3 (permalink)  
Old 07-28-2007, 09:37 PM
Basic4ppc Veteran
 
Join Date: Apr 2007
Posts: 200
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, 04:14 PM
RandomCoder's Avatar
Basic4ppc Veteran
 
Join Date: May 2007
Location: UK
Posts: 485
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, 18 views)
__________________
Desktop: Pentium D 920 (2.8GHz, 4MB L2 Cache, 800MHz FSB), 1024MB, 256MB Radeon X600, 250GB HD.
Device : Axim X51v XScale 624MHz, 3.7" VGA, 64MB SDRAM, 256MB Flash ROM + 1Gb SD.

"Defeat never comes to any man until he admits it."Josephus Daniels
Reply With Quote
  #5 (permalink)  
Old 07-29-2007, 06:29 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,686
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
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 07:07 PM.
Reply With Quote
  #6 (permalink)  
Old 07-29-2007, 08:25 PM
Junior Member
 
Join Date: Apr 2007
Location: Cornwall UK
Posts: 22
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 On
Pingbacks are On
Refbacks are On

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


All times are GMT. The time now is 11:19 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0