Solved

formatted user control

Posted on 1998-08-10
3
133 Views
Last Modified: 2010-04-30
I have written a usercontrol based on a textbox that will format and validate the data entered to the required set property, ie. Y2K date, long, decimal to two places, etc. It works well but has a serious flaw. The control uses the show,lostfocus and resize events to format and validate its data. However if I want to place a calculated value into the control from an action somewhere else none of the above events get called and I have raw data in the control. Is there a way to kick the usercontrol into realising that its data has been changed?.  
0
Comment
Question by:tinybyte
3 Comments
 
LVL 1

Expert Comment

by:brunchey
Comment Utility
Use the change event of the textbox or whatever control you are using.
0
 

Author Comment

by:tinybyte
Comment Utility
I wish it were that simple. The CHANGE event monitors each keystroke and if you entering a date it will give an error immediately because you can't have a one letter date or if it is a numeric to two decimal places will immediately give 1.00 etc . What I need is a method for the control to recognise that a calculated value from another source is NOT coming from the keyboard and then format and validate it. With keyboard entry the ENTER key, lostfocus signify that data entry is complete.
0
 
LVL 2

Accepted Solution

by:
percosolator earned 200 total points
Comment Utility
That sounds like an interesting control.

create a new property, or use the text property to kick-off your validation routines.

I would choose the former, create a new property, and on the property let validate the data, that way you have an alternative method of loading the control, but with no validation (Text).  Call it "ValidText" or something.




0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now