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.

TextBox Cursor

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-02-2007, 08:11 PM
RandomCoder's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Location: Derbyshire, UK
Posts: 614
Awards Showcase
Beta Tester 
Total Awards: 1
Default TextBox Cursor

I'm in need of some

My editable table program (http://www.basic4ppc.com/forum/code-samples-tips/487-editable-table.html) could be made better if the data in the TextBox was highlighted ready to be overwritten with new data.

This seems to have got the better of me even though I'm certain it must be possible.
So far I've tried turning the Focus onto the TextBox but this didn't work, I then tried selecting whatever data was in the TextBox but still no joy.
What else is there to do

Anyway, here's what I've already tried....
Code:
    TextBox1.Focus=True
TextBox1.SelectionStart=
0
TextBox1.SelectionLength= StrLength(TextBox1.Text)
Any takers on what I'm doing wrong?

Thanks,
RandomCoder
__________________
"Defeat never comes to any man until he admits it."Josephus Daniels
Reply With Quote
  #2 (permalink)  
Old 07-02-2007, 08:23 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 2,313
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Well randomcoder,

For starters, the focus method does NOT require to be True or False.
The correct syntax is textbox1.focus.

With that corrected it works fine, the text in textbox1 gets highlighted...Both on desktop(no code needed) ond ppc(with the code).
__________________
Paulo Gomes - Porto, Portugal - Living/Working in France-Saumur
Mobile Device: Samsung Galaxy S, Android 2.3.4 CUstom ROM
Laptop: Toshiba NB100-130 (running on Win7Ultimate)
B4PPC DLL Version Listing - B4Android DLL Version Listing
Reply With Quote
  #3 (permalink)  
Old 07-02-2007, 08:23 PM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 993
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Hi RandomCoder,

I took my posted EditableTablev1.1 and changed the Sub Timer_Tick into
Code:
Sub Timer1_Tick
    Timer1.Enabled = 
false
    TextBox1.SelectionLength = StrLength(TextBox1.Text)
    TextBox1.Focus
End Sub
I don't know why this must be done out of the SelectionChanged sub.

specci48
Reply With Quote
  #4 (permalink)  
Old 07-02-2007, 09:12 PM
RandomCoder's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Location: Derbyshire, UK
Posts: 614
Awards Showcase
Beta Tester 
Total Awards: 1
Default

CableGuy,

I feel that you are my friend and we joined roughly the same time but just so that you know, I did try TextBox1.Focus but that didn't work and so I used the full syntax just to try and dot all the i's and cross all the t's as it were.
You obviously didn't try it in my EditableTable App as it definitely does not work

Specci48,

Thank you, you've come to my rescue
The SelectionChanged Sub must have been keeping hold of the Focus.
The only problem now is that I suspect that I won't be able to use the arrow keys on the SIP to navigate around the table since the Focus is no longer on the Selected Cell.
I'll have to try this on the device to confirm this but at the moment am just putting my kids to bed.

Thanks,
RandomCoder
__________________
"Defeat never comes to any man until he admits it."Josephus Daniels
Reply With Quote
  #5 (permalink)  
Old 07-02-2007, 09:37 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 2,313
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

You are rigth ...and wrong...

I didn't try it in you editable table, I tryed it in a blankform with only a texbox in it, and it works...
In you first post you didnt specified that this was to be in the selection change event....

I never doubt of you skills as myself make a few dumb mistakes once in a while....

Never the less, Im glad your prob is solved....
__________________
Paulo Gomes - Porto, Portugal - Living/Working in France-Saumur
Mobile Device: Samsung Galaxy S, Android 2.3.4 CUstom ROM
Laptop: Toshiba NB100-130 (running on Win7Ultimate)
B4PPC DLL Version Listing - B4Android DLL Version Listing
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 scroll cursor taky Questions (Windows Mobile) 2 10-25-2008 06:15 PM
hide cursor micro Questions (Windows Mobile) 5 09-20-2008 12:01 PM
Get cursor position in textbox? tsteward Questions (Windows Mobile) 3 08-08-2008 02:16 AM
How to remove cursor from TextBox Bakhtiyor Questions (Windows Mobile) 6 07-01-2008 09:42 PM
Cursor JoseLuz Portuguese Forum 1 09-21-2007 07:30 PM


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


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