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.


TextBox Cursor


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

I'm in need of some

My editable table program (Editable Table) 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
__________________
Desktop: Pentium D 920 (2.8GHz, 4MB L2 Cache, 800MHz FSB), 1024MB, 256MB Radeon X600, 250GB HD.
Device : Axim X51v XScale 624MHz, 3.7" VGA, 64MB SDRAM, 256MB Flash ROM + 1Gb SD.

"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: 1,314
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

PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD
PPC: Qtek9000, 1GB SD

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: 636
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 Veteran
 
Join Date: May 2007
Location: UK
Posts: 485
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
__________________
Desktop: Pentium D 920 (2.8GHz, 4MB L2 Cache, 800MHz FSB), 1024MB, 256MB Radeon X600, 250GB HD.
Device : Axim X51v XScale 624MHz, 3.7" VGA, 64MB SDRAM, 256MB Flash ROM + 1Gb SD.

"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: 1,314
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

PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD
PPC: Qtek9000, 1GB SD

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Textbox scroll cursor taky Questions & Help Needed 2 10-25-2008 06:15 PM
hide cursor micro Questions & Help Needed 5 09-20-2008 12:01 PM
Get cursor position in textbox? tsteward Questions & Help Needed 3 08-08-2008 02:16 AM
How to remove cursor from TextBox Bakhtiyor Questions & Help Needed 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 01:08 PM.


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