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.


Copying from a textbox with IgnoreKey


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-10-2008, 09:59 AM
Senior Member
 
Join Date: Apr 2007
Location: Copenhagen
Posts: 143
Default Copying from a textbox with IgnoreKey

I have a textbox with a content which I want to protect from accidental changes. For this I am using a text box with IgnoreKey.

However I would also like the user to be able to copy parts from that text. Unfortunately the IgnoreKey also makes the textbox ignore ctrl-C (although you can mark text with shift-arrow). Is there any easy solution to this that I have overlooked?

all the best / Björn
Reply With Quote
  #2 (permalink)  
Old 03-10-2008, 12:01 PM
Filippo's Avatar
Basic4ppc Veteran
 
Join Date: May 2007
Location: Schwäb. Gmünd, Germany
Posts: 284
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Hello BjornF,

You can use the library fgControls.

fgControls-Library


Ciao,
Filippo
__________________
PPC: MDA Pro, 2GB SD
PPC: HTC Touch Diamond, 4GB
______________________
Reply With Quote
  #3 (permalink)  
Old 03-10-2008, 12:03 PM
Senior Member
 
Join Date: Apr 2007
Location: Copenhagen
Posts: 143
Default Stupid



Sorry, of course all you need to do is right click and then save... / Björn


Edit:
Filippo - that is very neat, I'll put that in as well (just for us who don't know how to use the right click), thanks
Reply With Quote
  #4 (permalink)  
Old 03-10-2008, 12:03 PM
Junior Member
 
Join Date: Dec 2007
Posts: 27
Default

You can do it by creating your own copy and paste buttons and using the selstart and sellength property. Example attached

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

Sub App_Start
	Form1.Show
	
End Sub


Sub TextBox1_KeyPress (key)
textbox1.IgnoreKey
End Sub

Sub btnCopy_Click
copyText=SubString(textbox1.text,textbox1.SelectionStart,textbox1.SelectionLength)
End Sub

Sub btnPaste_Click
textbox2.Text=copytext
End Sub
Attached Files
File Type: sbp textboxcopy.sbp (869 Bytes, 2 views)
Reply With Quote
  #5 (permalink)  
Old 03-10-2008, 01:23 PM
Senior Member
 
Join Date: Apr 2007
Location: Copenhagen
Posts: 143
Default

Thank you Leginus,
I can see that that is also a way of doing it, it's just that I'm a firm believer of standardisation and when you have learned that Ctrl-C copies the text in almost all applications it is very frustrating to encounter one in which it does not.

I think Filippo's ReadOnly mode for the textbox is exactly what I was after.

all the best / Björn
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
Copying files from shortcuts BjornF Questions & Help Needed 2 10-06-2008 09:47 AM
Textbox with ReadOnly,IgnoreKey,TextAlignment Filippo Basic4ppc Wishlist 0 11-17-2007 09:23 PM
IgnoreKey in ComboBox? kyto Questions & Help Needed 1 09-11-2007 05:51 AM
Copying .dll files into the windows folder specci48 Questions & Help Needed 1 05-28-2007 12:50 PM


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


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