Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
|
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 May 16th, 2007, 12:23 AM
Registered User
 
Join Date: May 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Textbox Font reverts to Tahoma

I have an unusual problem that happens on both Win98 and WinXP running Word 2002 (SP3) using VBA 6.3. For what it's worth, all Autocorrect options are turned off.

I want to be able to display text in a specific font in a TextBox. The problem is, when I set the value of the TextBox to a string containing characters like Chr(131), Chr(138) or Chr(160), the font for the remaining characters in the TextBox revert to Tahoma if their character index is greater than 130. When I manually enter text into a TextBox, I can cause a similar problem to occur using the characters 131 and 138. (Note that Tahoma is still the default font for TextBoxes on my system.)

This will recreate the problem to demonstrate what I mean;

1) In Word, create a form with a Textbox
2) Set the TextBox font to a font other than Tahoma but
   not a symbol font. Choose a font that looks significantly
   different - specially the character 131 (Looks like
   a comma). Make the font large so the difference is
   obvious.
3) Run the form
4) In the TextBox, press alt while entering 0130
     You should get a comma
5) Press backspace and delete the comma
6) Now, in the TextBox, press alt while entering 0131
     You should get the function sign ƒ
7) Press backspace and delete function sign ƒ
8) Now press alt while entering 0130 again
    You get a comma but the font is now Tahoma

Are these characters reserved for special purposes? I have searched all over the net for a solution to this problem or an indication as to why this is happening with no luck. Any help would be greatly appreciated.





Similar Threads
Thread Thread Starter Forum Replies Last Post
pointing cursor from one textbox to other textbox lakshmi_annayappa ASP.NET 1.0 and 1.1 Basics 2 August 2nd, 2007 03:41 PM
not enable textbox or combobox font color SabinoFonseca VB.NET 2002/2003 Basics 1 March 15th, 2007 01:52 PM
font saima Abdul Ghaffar ASP.NET 1.0 and 1.1 Basics 0 February 1st, 2007 04:36 AM
how to get font ,color,font size of text in win32 satishsatao Visual C++ 0 April 5th, 2006 05:05 AM
Masked TextBox & formatting TextBox melvik C# 1 September 22nd, 2003 11:01 AM





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