![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Questions & Help Needed Post any question regarding Basic4ppc. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
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 |
|
|||
![]() 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 |
|
|||
|
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 |
|
|||
|
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 |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
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 |