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

x
?
Solved

Lock the Mask Edit Box control

Posted on 1999-10-03
9
Medium Priority
?
380 Views
Last Modified: 2013-12-26
hi,

how can i lock the Mask Edit Box control from the user to type into it.

the 'Lock' property is absence. and the 'Enabled' property doesnt serve my needs, because the tooltiptext is not dis[layed when the control is disabled.

thanx in advance
efratk
0
Comment
Question by:efratk
[X]
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
  • 2
  • +1
9 Comments
 
LVL 9

Expert Comment

by:Dalin
ID: 2094628
In the Gotfocus event, add a code to send the focus to another control, such as:

command1.setfocus

or Text1.setfocus
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 2094663
Sending the focus to another control is not like the Lock property.

You can trap the Keypress event and return KeyAscii = 0 to cancel any character entered.
0
 

Author Comment

by:efratk
ID: 2094703
sorry dalin, your answer hasnt satisfied me,

emoreau! your answer solved my problem thank u.
emoreau, please answer to my question that i could give u the points.

thanx to u all
efratk

0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 70

Accepted Solution

by:
Éric Moreau earned 200 total points
ID: 2094713
Sending the focus to another control is not like the Lock property.

You can trap the Keypress event and return KeyAscii = 0 to cancel any character entered.
0
 

Author Comment

by:efratk
ID: 2094720
thanx u all.
0
 

Author Comment

by:efratk
ID: 2094722
thanx u all.
0
 
LVL 9

Expert Comment

by:Dalin
ID: 2094849
Actually, Set the focus away is more like Lock it.

set the KeyASCII to 0 only prevent from keyboard entry, but user can use the mouse and copy/paste content to the control.
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 2094856
When a control (like the TextBox) is locked, you can use it a source for copy-and-paste operation. If you set the focus away, you loose this behavior.

I agree that keypress won't stop a paste operation. In addition (or instead) of trapping the keypress event, you can trap the change event (by keeping the original value in the getfocus event and reapplying it in the change event).
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6822113
This question was awarded, but never cleared due to the JSP-500 errors of that time.  It was "stuck" against userID -1 versus the intended expert whom you awarded.  This corrects the problem and the expert will now receive these points; points verified.

Please click on your Member Profile and select "View Question History" to navigate through any open or locked questions you may have to update and finalize them.

This is the Community Support link, if help is needed, along with the link to All Topics since many new ones were recently added.

http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
http://www.experts-exchange.com/jsp/zonesAll.jsp
 
Thanks,
Moondancer
Moderator @ Experts Exchange
0

Featured Post

Industry Leaders: 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…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

660 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