How Do I Delete Text Using The 'Delete' Key Like Wordpad Does, I Already Have A Dropdown Menu With A Hotkey Of Delete, The Only Problem Is That I Dont Know How To Delete Text Without Getting A Box When I Try To Delete A Carriage Return?
Printable View
How Do I Delete Text Using The 'Delete' Key Like Wordpad Does, I Already Have A Dropdown Menu With A Hotkey Of Delete, The Only Problem Is That I Dont Know How To Delete Text Without Getting A Box When I Try To Delete A Carriage Return?
please specify what textbox r u using !
or supply some code.
There may be a few options for this one, but as the previous member said, more information is required please.
Regards
im using a multilined textbox, and heres the code that i was using that doesnt work -
<-----Code----->
Private Sub Delete_Click
Text1.Sellength = 1
Text1.SelText = ""
End Sub
<-----Code----->
Still not quite sure what you are attempting to achieve here. Purely by setting Text1.SelText to "" (omit the line Text1.SelLength = 1) will delete any highlighted text in the text box, and also pressing the delete key will give the same result. You can put that code in a sub routine and call it from your menu routine (or put it directly in the menu control's code). And what is this "box" you are getting when you try to delete a carriage return?
Sorry to be a pain...Please elaborate
This box that im talking about is a box that i get when i try to delete something that isnt there (you also get the box in the file when you try to make a Wordpad doc into a text file).Sorry Its Hard To Explain...
like an error box?
on error goto hell
'code
'code
'code
hell:
msgbox "on error occured possible cause u screw3d up",,"title"
No Not A Error Box, Its A Box Inside The Textbox Thats The Size Of A Character.
Yeah Thats What It Is, I Get That Thing When I Try To Delete This(Its Hard To Explain):
----------------------------------
|Hello, How Are You Today, |
|Im Fine. |
----------------------------------
` Hello, How Are You Today, Is Deleted But Right Before Im Fine Takes Its Place I Get
----------------------------------
| |
|Im Fine |
----------------------------------
Hold on a sec.
you were using this code because your Del key was a Shortcut for a menu? If the menu's purpose is to Delete something, then you should only use Text1.SelText=""Code:Private Sub Delete_Click
Text1.Sellength = 1
Text1.SelText = ""
End Sub
Yes I Tried That, But When You Try To Delete A Carriage Return, That Rectangle Comes up, And I Dont Want The Rectangle To Come Up.