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?

Readonly property in the Textbox control

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-07-2007, 08:59 PM
bidibulle's Avatar
Junior Member
 
Join Date: Oct 2007
Location: France
Posts: 13
Awards Showcase
Beta Tester 
Total Awards: 1
Default Readonly property in the Textbox control

Hi,

Is it possible to add the readonly property to the textbox control?
It exist in VS2005.

--
Pierre
Reply With Quote
  #2 (permalink)  
Old 11-07-2007, 09:34 PM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 993
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

As a "workaround", set TextBox.Enabled = False, or uncheck the enabled checkbox directly in the form editor.
Reply With Quote
  #3 (permalink)  
Old 11-07-2007, 10:17 PM
Junior Member
 
Join Date: Apr 2007
Location: Spain
Posts: 13
Default

Problem with TextBox.Enabled = False or unchecking the enabled checkbox directly in the form editor is that textbox font color change to grey.

What you can do is leaving Textbox enabled and add this method:

Code:
Sub Textbox1_KeyPress (key)
    Textbox1.IgnoreKey
End Sub
Textbox is enabled but you can't write anything inside.
__________________
Discovering Basic4PPC, Great Job!!!
Reply With Quote
  #4 (permalink)  
Old 11-09-2007, 11:49 AM
bidibulle's Avatar
Junior Member
 
Join Date: Oct 2007
Location: France
Posts: 13
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Thanks Nkieto for the tips.
I tested it. It works but it's not perfect.

For the moment I will use it but if Erel can add the property in the next version it will be great.

Anyway thanks for the support and thanks Erel for this great tool.
Reply With Quote
  #5 (permalink)  
Old 11-09-2007, 04:12 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Quote:
Originally Posted by bidibulle View Post
I tested it. It works but it's not perfect.
In what way? I tried it and it seems to feel the same to the user as setting the ReadOnly property.

If you want to access properties not exposed by B4PPC and you have SharpDevelop or VS2003 or VS2005 you can always knock up a small library like the one attached.

More generally to everyone else - after installing .NET 1.1 to get version 5.80 to compile I now "appear" to be able to target .Net 1.0 for the device with VS2005. I had assumed that I would need to install the whole .NET 1.1 SDK. Can somebody who only has .NET 1.0 on their device try this for me please!
Attached Files
File Type: zip ReadOnly.zip (2.5 KB, 27 views)
Reply With Quote
  #6 (permalink)  
Old 11-10-2007, 09:18 AM
taximania's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Location: Derbyshire. UK
Posts: 585
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Hi agraham.

Had a little play with your code. Attatched.

On the Desktop.
When ReadOnlyTextBox.ReadOnly = 'True or False' the textbox remains white and the text is black.

On my Device.
When ReadOnlyTextBox.ReadOnly = True the entire texbox is gray and the text is black.

When TextBox2.Enabled = False, the textbox remains white and the text is gray on both Desktop and Device.

Not sure if this is a useless post. It was just an observation.

What I do know is that if I start a new #Sharp project and use your code, It will compile and run on the Desktop, but not my device
__________________
.
.
.
Don't ask, I'm fine, honest. !!
.
.
.
Just a little crazy at times



O2 XDA, GW Evo 2.1 UC WWE Rom, WM6.1
Radio Ver 03.34.90
With Basic4ppc V6.80


http://www.taximania.co.uk

Last edited by taximania : 11-10-2007 at 09:30 AM.
Reply With Quote
  #7 (permalink)  
Old 11-10-2007, 10:26 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Quote:
Originally Posted by taximania View Post
What I do know is that if I start a new #Sharp project and use your code, It will compile and run on the Desktop, but not my device
It was a quickly knocked up to test a point and the reference to System.Text is not needed. However even with that the dll I compiled works on my device.

Are you sure that your compilation is really targeting the device? I don't know SharpDevelop but I believe that it is easy to change the target by a menu option somewhere.
Reply With Quote
  #8 (permalink)  
Old 11-10-2007, 01:57 PM
Filippo's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Location: Schwäb. Gmünd, Germany
Posts: 906
Awards Showcase
Beta Tester 
Total Awards: 1
Default

hi,

here is my TextBoxReadOnly

Ciao,
Filippo
Attached Files
File Type: sbp TextBoxReadOnly.sbp (1.2 KB, 20 views)
__________________
PPC: MDA Pro, 2GB SD
Device: HTC Desire , Android 2.2
______________________
Reply With Quote
  #9 (permalink)  
Old 11-10-2007, 02:17 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

I am afraid your code is dangerous - you are adding an events every time the textbox gets the focus and the user can still select the text box. Try this

Code:
Sub Globals
    
'Declare the global variables here.
 End Sub

Sub App_Start
  Form1.Show
End Sub

Sub cmdShow_Click
  txtReadOnly.Text=txtReadWrite.Text
End Sub

Sub txtReadonly_GotFocus
    txtReadWrite.Focus
End Sub
Reply With Quote
  #10 (permalink)  
Old 11-10-2007, 02:29 PM
Filippo's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Location: Schwäb. Gmünd, Germany
Posts: 906
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Hallo agraham,

You have not understood mine code! It should be only one beispiel like a text box readonly can become.
__________________
PPC: MDA Pro, 2GB SD
Device: HTC Desire , Android 2.2
______________________
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 Readonly IansResearch Questions (Windows Mobile) 12 12-22-2008 04:12 PM
Textbox with ReadOnly,IgnoreKey,TextAlignment Filippo Basic4ppc Wishlist 0 11-17-2007 09:23 PM
Can ComboBox be setted as readonly? blackiice Questions (Windows Mobile) 4 10-24-2007 04:15 PM
Catch hardkeys in textbox control ? conf Questions (Windows Mobile) 2 06-15-2007 11:28 PM
textbox control error in v5 Put Claude Bug Reports 2 05-19-2007 09:22 PM


All times are GMT. The time now is 04:12 AM.


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