-
edit mask for numeric
hi
any one can tell me how i can make edit mask for field 5,3
i put #####.### in mask but it need to fill the first 5 first places then
write the decimal part i want write for example 2 digit the press decimal
point then the reset of blank to decimal point truncat and write the decimal
part
thanks
-
Re: edit mask for numeric
Try this KeyPress event code for the MaskEdBox:
Private Sub MaskEdBox1_KeyPress(KeyAscii As Integer)
Dim TempText As String
Dim MaskDecPt As Long
With MaskEdBox1
MaskDecPt = InStr(MaskEdBox1.Mask, ".")
If KeyAscii = Asc(".") And .FormattedText Like "* .*" Then
TempText = .Text
Mid$(TempText, 1, MaskDecPt) = String$(MaskDecPt - _
Len(.ClipText) - 1, .PromptChar) & .ClipText
.Text = TempText
.SelStart = MaskDecPt
End If
End With
End Sub
Is that what you were looking for? (I wasn't 100% sure of what your question
was.)
Rick
"hammam" <mhdhamam@hotmail.com> wrote in message
news:390a632f$1@news.devx.com...
>
> hi
> any one can tell me how i can make edit mask for field 5,3
> i put #####.### in mask but it need to fill the first 5 first places then
> write the decimal part i want write for example 2 digit the press decimal
> point then the reset of blank to decimal point truncat and write the
decimal
> part
>
> thanks
-
Re: edit mask for numeric
thanks rick
your subroutine worked correctlly 100%
would u please tell me how i can display this no into maskedit
no like 12.55 take care the mask for this field is #####.###
thanks
"Rick Rothstein" <rick_newsgroup@email.com> wrote:
>Try this KeyPress event code for the MaskEdBox:
>
>Private Sub MaskEdBox1_KeyPress(KeyAscii As Integer)
> Dim TempText As String
> Dim MaskDecPt As Long
> With MaskEdBox1
> MaskDecPt = InStr(MaskEdBox1.Mask, ".")
> If KeyAscii = Asc(".") And .FormattedText Like "* .*" Then
> TempText = .Text
> Mid$(TempText, 1, MaskDecPt) = String$(MaskDecPt - _
> Len(.ClipText) - 1, .PromptChar) & .ClipText
> .Text = TempText
> .SelStart = MaskDecPt
> End If
> End With
>End Sub
>
>Is that what you were looking for? (I wasn't 100% sure of what your question
>was.)
>
>Rick
>
>
>"hammam" <mhdhamam@hotmail.com> wrote in message
>news:390a632f$1@news.devx.com...
>>
>> hi
>> any one can tell me how i can make edit mask for field 5,3
>> i put #####.### in mask but it need to fill the first 5 first places then
>> write the decimal part i want write for example 2 digit the press decimal
>> point then the reset of blank to decimal point truncat and write the
>decimal
>> part
>>
>> thanks
>
>
-
Re: edit mask for numeric
Are you asking how to use the number 12.55 that a user typed into the
MaskEdBox? If so, you would get it from the FormattedText property (Trim it
to remove the leading and trailing blank spaces). If you are asking
something different, you will have to phrase your question differently.
Rick
"hammam" <mhdhamam@hotmail.com> wrote in message
news:390b0966$1@news.devx.com...
>
> thanks rick
> your subroutine worked correctlly 100%
> would u please tell me how i can display this no into maskedit
> no like 12.55 take care the mask for this field is #####.###
> thanks
>
> "Rick Rothstein" <rick_newsgroup@email.com> wrote:
> >Try this KeyPress event code for the MaskEdBox:
> >
> >Private Sub MaskEdBox1_KeyPress(KeyAscii As Integer)
> > Dim TempText As String
> > Dim MaskDecPt As Long
> > With MaskEdBox1
> > MaskDecPt = InStr(MaskEdBox1.Mask, ".")
> > If KeyAscii = Asc(".") And .FormattedText Like "* .*" Then
> > TempText = .Text
> > Mid$(TempText, 1, MaskDecPt) = String$(MaskDecPt - _
> > Len(.ClipText) - 1, .PromptChar) & .ClipText
> > .Text = TempText
> > .SelStart = MaskDecPt
> > End If
> > End With
> >End Sub
> >
> >Is that what you were looking for? (I wasn't 100% sure of what your
question
> >was.)
> >
> >Rick
> >
> >
> >"hammam" <mhdhamam@hotmail.com> wrote in message
> >news:390a632f$1@news.devx.com...
> >>
> >> hi
> >> any one can tell me how i can make edit mask for field 5,3
> >> i put #####.### in mask but it need to fill the first 5 first places
then
> >> write the decimal part i want write for example 2 digit the press
decimal
> >> point then the reset of blank to decimal point truncat and write the
> >decimal
> >> part
> >>
> >> thanks
> >
> >
>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks