-
Oct 15th, 2010, 04:06 PM
#1
Thread Starter
Lively Member
Exact Code Produces Different Results
So, I have this code.
vb Code:
Case Keys.U With Me.TextBox1 Dim selectionStart As Integer = .SelectionStart Dim selectionLength As Integer = .SelectionLength .SelectedText = underline & .SelectedText & underlineend .SelectionStart = selectionStart + underline.Length .SelectionLength = selectionLength End With Case Keys.I With Me.TextBox1 Dim selectionStart As Integer = .SelectionStart Dim selectionLength As Integer = .SelectionLength .SelectedText = underline & .SelectedText & underlineend .SelectionStart = selectionStart + underline.Length .SelectionLength = selectionLength End With
It is inside if e.modifiers = keys.shift and a select case e.keycode
The code inside case keys.u is the exact same as keys.i, yet whenever I press control-i, it adds a whole bunch of spaces between the "underline" and "underlinelength" strings. So control-u produces
but control-i, with the exact same code, produces
It's getting really frustrating... can someone please shed some light on this ridiculous malfunctioning?
Urgh, and what I find EVEN MORE annoying is that if I replace e.keycode = keys.i with e.keycode = keys.p, there is no problem!
Last edited by Raeki; Oct 15th, 2010 at 04:18 PM.
-
Oct 15th, 2010, 04:39 PM
#2
Re: Exact Code Produces Different Results
Have you put a breakpoint in those two cases to see what the selection length is? What I am wondering is whether the issue is within that code, or in the selectedtext. Of course, it would probably look the same, so I guess the actual comparison would be on the selectedText.Length property.
My usual boring signature: Nothing
-
Oct 15th, 2010, 08:09 PM
#3
Thread Starter
Lively Member
Re: Exact Code Produces Different Results
I found that control-i seems to put that big block of spaces in... its one big character
Any way to cancel that? The auto-recognition like control-z is autmatic without me coding anything
-
Oct 17th, 2010, 11:21 AM
#4
Re: Exact Code Produces Different Results
Do you have any hotkeys defined on that computer? A big chunk of space like that sounds like a tab, or some similar thing. If you identify that, you might figure out why it is being added. Offhand, I don't know of anything. Of course, if it always happens, and the length is one higher than it should be, you might just remove that one character whenever you press that key combination.
My usual boring signature: Nothing
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|