Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Basic4ppc Wishlist
Home Register FAQ Members List 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: 53
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: 2,780
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: 53
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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Capture name of control that has focus aerohost Questions & Help Needed 5 06-21-2008 10:31 PM
set focus function gjoisa Questions & Help Needed 3 05-13-2008 04:53 PM
Focus text in textbox! superbabicka Questions & Help Needed 6 04-01-2008 11:48 AM
Focus pmu5757 Questions & Help Needed 2 03-21-2008 05:16 PM
listbox focus select using textbox Dr. Feelgood Questions & Help Needed 2 02-15-2008 12:25 AM


All times are GMT. The time now is 06:11 PM.


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