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.

"Online" monitored TextBox

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-31-2008, 05:46 AM
Standa's Avatar
Junior Member
 
Join Date: May 2007
Location: Czech Republic
Posts: 38
Send a message via MSN to Standa
Awards Showcase
Beta Tester 
Total Awards: 1
Default "Online" monitored TextBox

Hi,
I have wrote unit converter application. For starting calculate with value typed in textbox I use button control. But I want my program will calculate value immediately as I type it to textbox. Problem is, that KeyPress event at first does action programmed in KeyPress sub, and after it writes value I typed on SIP to textbox.

For example:
Code:
Sub TextBox1_KeyPress (key)
 TextBox2.Text=TextBox1.Text
End Sub
I try to handling it with Asc(key) etc., but it is more difficult than calculating of convert himself . I know other ways how to do it, but I want use TextBox and SIP (not own writed keyboard).
__________________
BlackBerry 8900, Dell Streak, SE MBW-150
Reply With Quote
  #2 (permalink)  
Old 05-31-2008, 09:52 AM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 1,057
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Hello Standa,

a possible workaround could be using a timer:
Code:
Sub Globals
    
'Declare the global variables here.
End Sub

Sub App_Start
    Timer1.Interval = 
1
    Timer1.Enabled = 
false
    Form1.Show
End Sub

Sub TextBox1_KeyPress (key)
    Timer1.Enabled = 
true
End Sub

Sub Timer1_Tick
    Timer1.Enabled = 
false
    
' do calculation
End Sub
The KeyPress events starts the timer and within the timer the TextBox1 has already the correct value.


specci48
Reply With Quote
  #3 (permalink)  
Old 05-31-2008, 10:27 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,733
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

You should use the TextChanged event instead of KeyPress.
You will need to add a reference to the door library.
There is an example in the door manual.
Reply With Quote
  #4 (permalink)  
Old 06-01-2008, 10:27 PM
Standa's Avatar
Junior Member
 
Join Date: May 2007
Location: Czech Republic
Posts: 38
Send a message via MSN to Standa
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Thank you guys. Door library is something like big gun against sparrow for my little application. So I try code with timer.
__________________
BlackBerry 8900, Dell Streak, SE MBW-150
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
"AddEvent" and "buttonUp/buttonDown" Byak@ Questions (Windows Mobile) 12 09-10-2008 03:04 PM
Neuling bei Basic4ppc - wollte mal "Hallo" sagen ... JOTHA German Forum 49 08-28-2008 11:59 PM
Is there any thing like Visual Basic "Tabbed dialog control" in Basic4ppc? mozaharul Questions (Windows Mobile) 6 03-23-2008 11:07 AM
Image Button kommt nicht wieder "hoch" troll German Forum 3 02-22-2008 09:03 AM
calling the device's "Programs" or "settings" screens HarleyM Questions (Windows Mobile) 0 12-05-2007 02:59 AM


All times are GMT. The time now is 09:42 AM.


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