|
-
December 8th, 1999, 12:13 AM
#1
How to make TAB key work for RichTextBox Control ?
Hi,
How can we make TAB key work for a Rich Text Box Control. I have set the properties TabStop = False, still it is not working.
Regards
RM
-
December 8th, 1999, 12:45 AM
#2
Re: How to make TAB key work for RichTextBox Control ?
I know this looks stupid, but it is the only way I have found and noone has told me different..
Dim bTABHit as Boolean
private Sub RichTextBox1_KeyDown(KeyCode as Integer, Shift as Integer)
If KeyCode = 9 then
bTABHit = true
iStart = RichTextBox1.SelStart
If iStart = 0 then
RichTextBox1.Text = vbTab & RichTextBox1.Text
else
strText = RichTextBox1.Text
RichTextBox1.Text = mid(strText, 1, iStart) & vbTab & mid(strText, iStart + 1, len(strText) - iStart)
End If
RichTextBox1.SelStart = iStart + 1
End If
End Sub
private Sub RichTextBox1_LostFocus()
If bTABHit then
bTABHit = false
RichTextBox1.SetFocus
End If
End Sub
--
Chizl
[email protected]
http://www.chizl.com/
-
December 8th, 1999, 07:58 AM
#3
Re: How to make TAB key work for RichTextBox Control ?
Try this...
Private Sub RichTextBox1_KeyDown(KeyCode as Integer, Shift as Integer)
If KeyCode = vbKeyTab then
RichTextBox1.SelText = vbKeyTab
KeyCode = 0
End if
End Sub
Tim.
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
|