Wrox Programmer Forums
|
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 9th, 2007, 01:36 PM
Friend of Wrox
 
Join Date: Jun 2005
Posts: 244
Thanks: 3
Thanked 4 Times in 4 Posts
Default A fun topic: Key Ascii

When somebody is writing in a rich text box if you press tab it changes focu to the next closest control! but what i want it to do is to insert a vbTab or "indent" into the rtb control so i was wondering y i cant do it like this:
Code:
Private Sub rtb_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyTab Then
        rtbText = rtb.Text
        rtbText = vbTab
    End If
End Sub
and possibly suggest a way to do it!

Cheers


------------------------------------------------
Apocolypse2005
Always ready and waiting to be helped!
__________________
Apocolypse2005, I'm a programmer - of sorts.
 
Old February 9th, 2007, 01:44 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

In VB6 I am not entirely sure but this post of mine:
http://p2p.wrox.com/topic.asp?TOPIC_ID=55289

It is in C# but it does the same thing essentially. What you need to do is handle the key press so that the normal functionality of the Tab key is replaced with what you want it to do.

hth.

================================================== =========
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========





Similar Threads
Thread Thread Starter Forum Replies Last Post
Divs, Gridviews and Javascript != fun mikeymikey ASP.NET 2.0 Professional 1 January 26th, 2007 02:10 PM
Make fun of my AJAX Site SomeGuy3 BOOK: Professional Ajax ISBN: 978-0-471-77778-6 0 July 13th, 2006 02:54 PM
What I think will be fun? hyfbeetle BOOK: ASP.NET Website Programming Problem-Design-Solution 1 June 27th, 2005 08:23 AM
Is this topic a professional topic?? mega ASP.NET 1.0 and 1.1 Professional 0 December 3rd, 2004 09:37 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.