|
-
Jul 18th, 2000, 02:33 AM
#1
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
-
Jul 18th, 2000, 02:38 AM
#2
Addicted Member
Explain more please..
I Dont really understand by "indent" what is it you are trying to accomplish?
explain more...
-
Jul 18th, 2000, 02:42 AM
#3
Hyperactive Member
Textboxes are poor
Use a RichTextBox instead...
Signed, Rodik ([email protected])
Programmer,usesVB6ED
===========================
Copyright©RodikCo,2002.
Dont mind this signature ;] Its old
-
Jul 18th, 2000, 02:43 AM
#4
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
-
Jul 18th, 2000, 02:46 AM
#5
Frenzied Member
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
-
Jul 18th, 2000, 03:17 AM
#6
Lively Member
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]
Mag-Net's Home
Visual Studio 6-Enterprise - SP4
ICQ: 35519773
Have Fun 
-
Jul 18th, 2000, 03:30 AM
#7
Frenzied Member
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
-
Jul 18th, 2000, 04:57 AM
#8
Lively Member
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.
Mag-Net's Home
Visual Studio 6-Enterprise - SP4
ICQ: 35519773
Have Fun 
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
|