If the focus is on a textbox, and you press TAB, the focus will goto the next control. How do I get it so that the TAB key will actually get me an indent in the textbox rather than going onto the next control?
Sunny
Printable View
If the focus is on a textbox, and you press TAB, the focus will goto the next control. How do I get it so that the TAB key will actually get me an indent in the textbox rather than going onto the next control?
Sunny
I Dont really understand by "indent" what is it you are trying to accomplish?
explain more...
Use a RichTextBox instead... :)
For example:
<indent>Then I start typing.
<indent>In normal WPs, indents are done by pressing TAB, but in a text box in VB, when you press TAB, the focus jumps to the next control, rather than giving an indent.
btw, 'indent' is the proper name for the 'space before a paragraph'
Sunny
Code:
Option Explicit
Sub toggleTabStops()
Dim ctrl As Control
For Each ctrl In Me.Controls
ctrl.TabStop = Not ctrl.TabStop
Next
End Sub
Private Sub Text1_GotFocus()
toggleTabStops
End Sub
Private Sub Text1_LostFocus()
toggleTabStops
End Sub
you could also test the keyascii argument in the keypress event of the text box for the ascii value of TAB which is 9, and then ignore it (KeyAscii = 0) and then type a coupla spaces. Ur choice.
[Edited by Mag-Net on 07-18-2000 at 05:53 AM]
Have you actually tried that Mag-Net?
firstly tab is 9
8 is backspace
secondly, neither keypress nor KeyDown events get fired when the tab key is pressed and there are other controls on the form with tabstop = true
okay, okay, i havent tried it, it was just a suggestion. Your idea is much better, and i mis-typed the 9, which i have now corrected.