Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Code Samples & Tips > Additional Libraries
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Additional Libraries Users contributed libraries.
This sub-forum is only available to licensed users.


fgControls-Library


Reply
 
LinkBack Thread Tools Display Modes
  #11 (permalink)  
Old 03-12-2008, 05:38 PM
Junior Member
 
Join Date: Oct 2007
Posts: 25
Default

Hello!

These controls are just what I need, but don't know how to write the code. Here is the problem:

In Textbox1 max length is 2. When that condition is true textbox2 must be focused. A short code please.

THX Kavka
Reply With Quote
  #12 (permalink)  
Old 03-12-2008, 06:26 PM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 521
Default

Hello Kavka,

try this:
Code:
Sub Globals
End Sub

Sub App_Start
    fgTextBox.New1("TextBox1",0)	
    fgTextBox.MaxLength = 2
    TextBox1.Focus
    Form1.Show
End Sub

Sub TextBox1_KeyPress (key)
    ' backspace pressed ?
    If Asc(key) = 8 Then
	Return
    End If
    If StrLength(TextBox1.Text & key) = 2 Then
	TextBox2.Focus
    End If
End Sub

specci48
Reply With Quote
  #13 (permalink)  
Old 03-12-2008, 06:32 PM
Junior Member
 
Join Date: Oct 2007
Posts: 25
Default

specci48, tried that, but does not work. It says:

"Object must first be created using New method."
Reply With Quote
  #14 (permalink)  
Old 03-12-2008, 06:48 PM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 521
Default

Ok, seems that you don't know how to handle with external libraries in basic4ppc yet.
You can take he beginning of this thread GPS application - Part I as an example for that.

As an addition, I provided my full example with this post.


Hope that helps you to little...

specci48
Attached Files
File Type: zip Focus.zip (5.8 KB, 11 views)
Reply With Quote
  #15 (permalink)  
Old 03-12-2008, 07:16 PM
Junior Member
 
Join Date: Oct 2007
Posts: 25
Default

Your code works. I did all the same (library and all). I don't know what the problem is.

THX, Kavka
Reply With Quote
  #16 (permalink)  
Old 03-12-2008, 07:17 PM
Bobbes's Avatar
Senior Member
 
Join Date: Oct 2007
Posts: 146
Default

Hi Kavka,
here is a little programm. I hope it is usefull for you.

Bobbes
Attached Files
File Type: zip test textbox.zip (5.8 KB, 16 views)
Reply With Quote
  #17 (permalink)  
Old 03-13-2008, 07:37 PM
Junior Member
 
Join Date: Oct 2007
Posts: 25
Default

Bobbes! Thanx for the code. My next question is: Is it possible to define maxlenght for each textbox separately. (Textbox1 maxlenght is 2, Textbox2 maxlenght is 5).

Thx, Kavka
Reply With Quote
  #18 (permalink)  
Old 03-13-2008, 08:50 PM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 521
Default

Add a second fgTextBox object (e.g. fgTextBox2) to the project and this additionally
Code:
    fgTextBox2.New1("TextBox2",0)	
    fgTextBox2.MaxLength = 5
e.g. to the App_Start sub.


specci48
Reply With Quote
  #19 (permalink)  
Old 03-13-2008, 09:41 PM
Junior Member
 
Join Date: Oct 2007
Posts: 25
Default

Thx, Kavka
Reply With Quote
  #20 (permalink)  
Old 03-13-2008, 09:51 PM
Bobbes's Avatar
Senior Member
 
Join Date: Oct 2007
Posts: 146
Default

Hi Kavka,
the frist prog was very buggy, here is the Update

Best wishes
Bobbes
Attached Files
File Type: zip Test Update.zip (5.8 KB, 11 views)
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
Text Editor Henshu mit fgControls alfcen German Forum 2 07-03-2008 11:37 AM
Merging Outlook library and Phone library Erel Official Updates 1 06-02-2008 06:04 PM
Door library (Beta) - Special library Erel Official Updates 45 05-29-2008 07:15 PM


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


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