Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

TDBedit editmask - how?

0 views
Skip to first unread message

Fred Kreshak

unread,
Nov 1, 1997, 3:00:00 AM11/1/97
to

I gather from Delphi3's help screens and messages here that TDBedit has
the ability to have an editmask but the properties list does not show
it and help is of no help. Messages here, similarly, allude to this
possibility but do not describe how to implement this.

I'm new to Delphi3 so any help would be appreciated.

Fred

Peter Below

unread,
Nov 1, 1997, 3:00:00 AM11/1/97
to

Fred,

you set the edit mask in the TField object that is associated with the
TDBEdit.

Peter Below (TeamB) 10011...@compuserve.com)

In article <01bce66d$64e3b680$50c5b8cd@fred>, Fred Kreshak wrote:
> From: "Fred Kreshak" <Fred...@ix.netcom.com>
> Newsgroups: borland.public.delphi.vcl.components.using
> Subject: TDBedit editmask - how?
> Date: 1 Nov 1997 02:19:19 GMT

Peter Below

unread,
Nov 1, 1997, 3:00:00 AM11/1/97
to

Fred Kreshak

unread,
Nov 1, 1997, 3:00:00 AM11/1/97
to

Peter,
Thank you, but I still don't understand - even after several hours
searching help and a helf full of books.

In design mode
TDBedit has an isMasked property but no way to set the mask, nor could
I find a way in the datasource or data set.
There is a Tmaskedit control which you can put on a form. It has an
editmask property and, in the opject inspector you can click on this
property and invoke an edit mask editor dialog. But I see no way to
connect this to the TDBedit control or to the datasource or dataset.

I found in one book that you can do this programmatically, e.g.:
Table1SocialSecurity.editMask := '000\-00\-000;1;_'
but I have not tried this

Is this the only way to set an editmask on a database field?

Fred

Peter Below <10011...@compuserve.com> wrote in article
<VA.000007cf.000b050c@petersnewbox>...

Rick Rogers [TeamB]

unread,
Nov 1, 1997, 3:00:00 AM11/1/97
to

In article <01bce6dd$551483e0$6dc5b8cd@fred>, Fred Kreshak wrote:
> Is this the only way to set an editmask on a
> database field?

No. Here are the steps:

1. Drop a TTable (or TQuery) on your form or data module.
2. Set the TTable.DataBaseName property
3. Set the TTable.TableName property
4. Double-click the TTable component to bring up the Fields Editor
5. Right-click the Fields Editor to bring up the context menu
6. Select the Add Fields menu item
7. Select fields you wish to add, and click the OK button
8. Pressing OK in #7 returns you to the Fields Editor
9. In the Fields Editor, select ONE of the fields you added
10. #9 will select the field component in the Object Inspector
11. Look at the field's properties in the Object Inspector
12. One property is called EditMask. That's the one you want.

--
Rick Rogers (TeamB) | Fenestra Technologies

Fred Kreshak

unread,
Nov 3, 1997, 3:00:00 AM11/3/97
to

Thank you, thank you. Your explanation made it clear and the edit mask
works fine. I wish this explanantion was in the Help screens; it would
have saved hours. It would also be helpful if the edit mask
characters/formats were on this help screen or a linked screen.
thanks again

Rick Rogers [TeamB] <ri...@fenestra.com> wrote in article
<VA.00000b4...@Rosetta.fenestra.com>...

Rick Rogers [TeamB]

unread,
Nov 3, 1997, 3:00:00 AM11/3/97
to

In article <01bce88e$34670ca0$5ce0d3c6@fred>, Fred Kreshak wrote:
> I wish this explanantion was in the Help screens

An exhaustive explanation of the issue is included in both the on-line
help and the paper documentation. See the help topic "Working with
field components" (search for field in the index) and the subsequent
topics, which you can access with the >> button. The documentation on
these topics is actually quite well written and complete.

J. van der Velde

unread,
Nov 4, 1997, 3:00:00 AM11/4/97
to Fred Kreshak

Fred,

Look at the DBVldEdit Component, this object is an alternative for the
DBEdit object.
enhanced capailities are

· Validating data Before leaving the field
· Maintaining Focus and Caret after showing messages
· Instant trapping of Required fields
· Suspending validation on special events
· Filling of default values on creating new records
· MaskEdit capabilities
· Alert beep controlable

Description:

Added is an OnValidate event to check data before leaving the field.( the
OnExit event is
executed after leaving the field). It leaves the focus on the DBVldEdit
field.
Tabbing trough other fields (or controls) or clicking another object
invokes the event to
happen.
To insure that the validation can be overridden, a property CtlNames is
created which is a
list of controls that can be set that do not invoke the OnValidate
event.(for instance an Find
Button to lookup some value in a second form)

When adding a new record defaults can be filled out from the component
itself. It has a
property that can be filled out for this purpose.

The EditMask propertyis added so data can be formatted when entered. It
works as the
normal EditMask property on an MaskEdit component.

Beeping can be toggled on the validation When the message you generate
beeps also it can
get annoying for the End User.

It can be found at: Http://www.skzl.nl/~jvdvelde

Kind regards, Sjef van der Velde

0 new messages