Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Seeking for an alternative to a mask box

Posted on 2000-04-19
Medium Priority
Last Modified: 2013-12-26
I use the mask box that comes with VB 6 with no mask and with formatting. When it gets the focus the formatting stops, and when it loses the focus, the formatting takes charge again. It works OK for me, except for one problem: it is not possible to justify right or center. My question is then: how could I have the functionality of a mask box and justification at the same time? Is there any other similar control?
Thanks for any help.
Question by:Alberto071397
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
LVL 10

Accepted Solution

caraf_g earned 150 total points
ID: 2733794
Try this:

With the smartbox you can implement any validation you like. As an example I provided a really silly one, where you simply cannot type, paste, or by any other means get the string "ABA" into the text box except through code of course ;-)

Start Group1.vbg to see the example.

Hope this helps.

Expert Comment

ID: 2735056
You may have to code a text box in the change or keypress events.  What kind of formatting are you looking for.
LVL 10

Expert Comment

ID: 2735109
Sage, you're right. See my example, it's based on that principle. It wraps an ordinary text box into a user control, and it publicises an event through which a programmer using the control can implement an input validation that can be applied to the text box.

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.


Author Comment

ID: 2736984
Thanks to caraf_g and Sage for the comments.
I downloaded caraf_g's example. It seems to be well programmed and I have no doubt that it will perform as expected, but frankly, I was hoping that there was a simpler answer to my quest, which is just to make a mask box be able to justify its contents to the right. I need this to show currency amounts.
I also would like to say that, although I'm not really a VB beginner, I haven't programmed that much either.

Author Comment

ID: 2886076
Comment accepted as answer

Author Comment

ID: 2886077
Even though this answer was a bit complicated for me to use, I want to assign the points to caraf_g for his effort.
LVL 10

Expert Comment

ID: 2886706

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question