Recognizing Tab Key

Recognizing Tab Key

Question:
I have a text box that updates a memo field in Access.I would like to give the users the ability to insert tabs.The KeyDown and Keypress will not recognize the tab key.

Answer:
Inserting tab characters is a bit of a pain because the Tab is intercepted by Windows. What I would suggest that you do is to allow the user to press Control-T to put in a tab, which you can intercept (Ascii Code = 20). Then set the SelText property of the text box equal to a certain number of spaces rather than using the ASCII Tab character.It is possible to put Tab functionality into a textbox. But to do so you have to turn off the TabStop property for all controls on your form, thus breaking the ability for your users to tab from control to control. Since tabbing between controls is part of the Windows standards you should think hard about your app’s need to do this before employing this sort of functionality.Code to toggle TabStop state looks like this:

Sub ChangeTabStops (flag As Integer)’if flag = False this sub turns off all the tab stop properties on all the’controls on Form1’Passing flag = True turns the tab stops back onDim i As IntegerOn Error Resume Next  For i = 0 To Form1.Controls.Count – 1   ‘ Use the Controls collection    Form1.Controls(i).TabStop = flag         ‘set the Tabstop property to either True or False  NextEnd Sub
If you’re not happy with the default size of the Tab’s space you can use the SendMessage API call along with the EM_SETTABSTOPS constant to change it. Be careful on the declare for this because the 32-bit version is a lot different than the 16-bit one.

Share the Post:
Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved

AI is revolutionizing fraud detection

How AI is Revolutionizing Fraud Detection

Artificial intelligence – commonly known as AI – means a form of technology with multiple uses. As a result, it has become extremely valuable to a number of businesses across

AI innovation

Companies Leading AI Innovation in 2023

Artificial intelligence (AI) has been transforming industries and revolutionizing business operations. AI’s potential to enhance efficiency and productivity has become crucial to many businesses. As we move into 2023, several

data fivetran pricing

Fivetran Pricing Explained

One of the biggest trends of the 21st century is the massive surge in analytics. Analytics is the process of utilizing data to drive future decision-making. With so much of

kubernetes logging

Kubernetes Logging: What You Need to Know

Kubernetes from Google is one of the most popular open-source and free container management solutions made to make managing and deploying applications easier. It has a solid architecture that makes