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

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

Basic4ppc Wishlist Missing any feature?

Focus

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-21-2008, 01:24 PM
pmu5757's Avatar
Knows the basics
 
Join Date: Sep 2007
Location: Metz (France)
Posts: 67
Default Focus

Hello !
First, excuse the poor english of a frenchy...

I'm making a program that ask questions to the user.
The user must type the answer in a textbox, and then click an OK button to check if the answer is right or not.
To make the answer easier to type, I've set the focus on the answer textbox.
But it's impossible for the user to type enter instead ok clicking ok because the focus is not on the ok button.
Does it exist a solution to make it possible ?

Thank you

Pascal.

Last edited by pmu5757 : 03-21-2008 at 01:26 PM.
Reply With Quote
  #2 (permalink)  
Old 03-21-2008, 01:44 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,689
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

You can use a code similar to:
Code:
Sub App_Start
    Form1.Show
End Sub


Sub TextBox1_KeyPress (key)
    
If Asc(key) = 13 Then 
        textbox1.IgnoreKey
        button1_click
    
End If
End Sub

Sub Button1_Click
    
Msgbox(textbox1.Text)
End Sub
TextBox1 should be a MultiLine textbox.
Reply With Quote
  #3 (permalink)  
Old 03-21-2008, 05:11 PM
pmu5757's Avatar
Knows the basics
 
Join Date: Sep 2007
Location: Metz (France)
Posts: 67
Default Focus

It works very well, thank you.
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
TextBox Focus cdeane Questions (Windows Mobile) 6 10-16-2008 03:17 PM
Capture name of control that has focus aerohost Questions (Windows Mobile) 5 06-21-2008 10:31 PM
set focus function gjoisa Questions (Windows Mobile) 3 05-13-2008 04:53 PM
Focus text in textbox! superbabicka Questions (Windows Mobile) 5 04-01-2008 11:48 AM
Focus pmu5757 Questions (Windows Mobile) 2 03-21-2008 05:16 PM


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


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