Textbox tabs 
Author Message
 Textbox tabs

When in a multiline textbox, I want to be able to set how many spaces get
skipped when you hit the tab key.  It seems to be 14 and cannot be changed.
Is this possible in VB.net with the standard textbox, a richtextbox, or some
other method?

TIA,
  Joe



Sun, 06 Feb 2005 23:14:02 GMT  
 Textbox tabs

Quote:
> When in a multiline textbox, I want to be able to set how many spaces
get
> skipped when you hit the tab key.  It seems to be 14 and cannot be
changed.
> Is this possible in VB.net with the standard textbox, a richtextbox,
or some
> other method?

You can respond to the KeyPress event.

    Private Sub TextBox2_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress
        If e.KeyChar = vbTab Then
            ' Do something here.      
        End If
    End Sub

--
Peter Wu
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no
rights.



Mon, 07 Feb 2005 13:41:56 GMT  
 Textbox tabs
Thanks, but I already knew that.  What I need is something to put in the
place of your 'Do something here comment, that actually skips like 5 - 7
spaces, but without actually putting spaces in, so that it works just like
the tab key and you can just hit a single backspace to get rid of it.  I
assuming this isn't possible or you would have already answered with a way
to do this.   Thanks though.

- Joe



Quote:
> > When in a multiline textbox, I want to be able to set how many spaces
> get
> > skipped when you hit the tab key.  It seems to be 14 and cannot be
> changed.
> > Is this possible in VB.net with the standard textbox, a richtextbox,
> or some
> > other method?

> You can respond to the KeyPress event.

>     Private Sub TextBox2_KeyPress(ByVal sender As Object, ByVal e As
> System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress
>         If e.KeyChar = vbTab Then
>             ' Do something here.
>         End If
>     End Sub

> --
> Peter Wu
> Microsoft Corporation

> This posting is provided "AS IS" with no warranties, and confers no
> rights.



Mon, 07 Feb 2005 20:20:27 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. help changing textbox tab size

2. tab and shift tab in textbox

3. textbox auto tab to next textbox

4. ACC97: Tab in a Textbox

5. Tabbing between textboxes or other objects

6. Determining Tab order of TextBoxes in Word using VBA

7. Changing the tab widths in a textbox control

8. Changing the tab widths in a textbox control

9. BUG(?): disabling the tab key in a subclassed textbox

10. tabbing with textboxes on asp pages

11. Tab in TextBox

12. Capturing TAB key inside of TextBox (vb4)

 

 
Powered by phpBB® Forum Software