Solved

Seeking for an alternative to a mask box

Posted on 2000-04-19
7
171 Views
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.
---Alberto.
0
Comment
Question by:Alberto071397
  • 3
  • 3
7 Comments
 
LVL 10

Accepted Solution

by:
caraf_g earned 50 total points
ID: 2733794
Try this:

http://homepage.eircom.net/~carafa/VBSamples/VB6/SmartBox.zip

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.
0
 
LVL 2

Expert Comment

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

Expert Comment

by:caraf_g
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.
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 

Author Comment

by:Alberto071397
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.
0
 

Author Comment

by:Alberto071397
ID: 2886076
Comment accepted as answer
0
 

Author Comment

by:Alberto071397
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.
0
 
LVL 10

Expert Comment

by:caraf_g
ID: 2886706
Whoopee...
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

831 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