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.


"Online" monitored TextBox


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-31-2008, 06:46 AM
Standa's Avatar
Junior Member
 
Join Date: May 2007
Location: Czech Republic
Posts: 26
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).
__________________
XDA Flame
Reply With Quote
  #2 (permalink)  
Old 05-31-2008, 10:52 AM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 650
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, 11:27 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,199
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, 11:27 PM
Standa's Avatar
Junior Member
 
Join Date: May 2007
Location: Czech Republic
Posts: 26
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.
__________________
XDA Flame
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
"AddEvent" and "buttonUp/buttonDown" Byak@ Questions & Help Needed 12 09-10-2008 04:04 PM
Neuling bei Basic4ppc - wollte mal "Hallo" sagen ... JOTHA German Forum 49 08-29-2008 12:59 AM
Is there any thing like Visual Basic "Tabbed dialog control" in Basic4ppc? mozaharul Questions & Help Needed 6 03-23-2008 12:07 PM
Image Button kommt nicht wieder "hoch" troll German Forum 3 02-22-2008 10:03 AM
calling the device's "Programs" or "settings" screens HarleyM Questions & Help Needed 0 12-05-2007 03:59 AM


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


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