Text/String API
Updated Monday December 26, 2011
   
Category
Topic
CoolTabs
vb6
vb5
vb4-32
vb4-16*
vb3*
VBnet CoolTabs Utility
Use this utility to format the tab stops in a list or textbox.

*Although CoolTabs can generate the code required for older editions of VB, all API declarations and API constants must be replaced with the proper 16-bit Windows API equivalents. Also, if converting backwards note that some of the LB_ and EM_ message values changed between 16- and 32-bit Windows.

SendMessage: Align Text Box Contents Using Tabstops
Like the list box method, how to align multi-column text data in a textbox without using the Courier font.  Jan 8.1997



Contents
vb6
vb5
vb4-32
SendMessage: Determine the Number of Lines in a Text Box
This code fills a label with the number of lines of text in a textbox as the user enters text. Jul 18.1998

SendMessage: Determine the Current Line in a Text Box
This code fills a label with the current line number that the user is on.  Jul 18.1998

SendMessage: Find Text Box Document Size via API
There may be times you might want a precise count of the size of the text in a textbox. While the FileLen() function can provide this information for a newly opened file, this code fills a label with the dynamic size of the document that updates as the user changes the text.  Jul 18.1998

SendMessage: Programmatically Scroll a Text Box Vertically
How to use the SendMessage API to programmatically scroll a textbox vertically by any number of lines. The code also contains an interesting speed comparison demonstrating the overhead involved when a control's property is referenced during a complex operation, over the recommend method of using temporary variables for this purpose.  Jul 18.1998

SendMessage: Text Selection Methods via API
Non-typical routines using APIs for selecting text.  Jul 18.1998

SendMessage: Text Range Selection via API
API method to select text based on its line number in a textbox. Sep 13.1998



Ellipses
vb6
vb5
vb4-32
DrawText: Add Ellipses to a File Path
Create an ellipsed string by specifying the size of the desired string in characters. May 20.2004

PathCompactPath: Adding Ellipses to a File Path
Create an ellipsed string in a length specified in pixels. May 20.2004

PathCompactPathEx: Adding Ellipses to a File Path
Create an ellipsed string to fit within a specific RECT, with path or end ellipses. May 20.2004



Effects
vb6
vb5
vb4-32
SendMessage: Add Balloon Tips to a Text Box
Nifty way to notify users under XP or later. Mar 10.2003

SetWindowLong: Turn a Text Box into a Resizable Control
API code to add a sizeable border to a textbox at runtime. Jan 25.1997

SendMessage: Align Text Box Contents Using Tabstops
Like the list box method, how to align multi-column text data in a textbox without using the Courier font.  Jan 8.1997

SetWindowLong: Special Text Box Styles and Messages
Customize the style for textboxes. Updated Aug 17.1998

SendMessage: Use Cue Banners to Prompt Users
XP-look prompting for edit and combo controls. Mar 10.2003

Pure VB: Cue Banners for the XP Impaired
The XP-style cue prompt for non-XP versions of Windows. Sep 29.2003



Text API
vb6
vb5
vb4-32
SHAutoComplete: Add AutoComplete to a VB Text Box
Use the SHAutoComplete API if you're running IE 5 or greater. Nov 27.1999

SendMessage: Make a Style-0 Combo Edit Read-Only
Method to disable text editing in a 'Style 0' combo box (VB5 or earlier, but works in VB6 too). May 5.1999

WM_CONTEXTMENU: Kill the Default Combo Box Context Menu
Eliminating the combo edit context menu via subclassing.  Dec 19.2000

WM_CONTEXTMENU: Kill the Default Text Box Context Menu
Eliminating the default textbox context menu via subclassing.  Jun 6.1999



String API
vb6
vb5
vb4-32
DrawText: Shorten Long Strings with Ellipses
Add the ability to create truncated strings containing ellipses. Jun 22.1998

Pure VB: Implementing a Number-To-Text Conversion Function
A multi-option number-to-text routine. May 21.1999



 

 
 

PayPal Link
Make payments with PayPal - it's fast, free and secure!

 
 
 
 

Copyright ©1996-2011 VBnet and Randy Birch. All Rights Reserved.
Terms of Use  |  Your Privacy

 

Hit Counter