maskedbox

Does the MaskEdBox have an alignment property?
markg1Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

vindevogelCommented:
No, but this won't help you I guess ....
You probably want to know how to do alignment with it, right ?
0
markg1Author Commented:
yep.
0
caraf_gCommented:
I just tried some API calls that work fine with a command button but they don't work with a masked edit box (or an ordinary text box for that matter)
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

vindevogelCommented:
No good solutions I can think of.

Rewrite it yourself ?
Find another on www.activex.com ?

0
markg1Author Commented:
I'll leave the question open for awhile to see if anyone else knows.
Thanks for the effort.
0
jbilCommented:
Try this.

'can give appearance of allingning text
'put maskedit inside picture1

Option Explicit

Dim maskAllign As String
Private Sub Form_Load()
Picture1.FontSize = MaskEdBox1.Font.Size
Picture1.BackColor = MaskEdBox1.BackColor
MaskEdBox1.BorderStyle = mskNone
maskAllign = "center" 'or "left","right"
Picture1.Height = MaskEdBox1.Height
Picture1.Width = MaskEdBox1.Width
MaskEdBox1.Text = ""
End Sub

Private Sub MaskEdBox1_Change()
Dim mywide
With MaskEdBox1
    mywide = Picture1.TextWidth(.Text & "   ")
    .Top = Picture1.ScaleTop
    .Width = mywide
End With

Select Case maskAllign
Case "center"
 MaskEdBox1.Left = Picture1.Width / 2 - MaskEdBox1.Width / 2

Case "right"
 MaskEdBox1.Left = (Picture1.Width - MaskEdBox1.Width)

Case "left"
 MaskEdBox1.Left = (Picture1.ScaleLeft)

End Select

End Sub

Private Sub Picture1_GotFocus()
MaskEdBox1.SetFocus
End Sub

0
markg1Author Commented:
THANKS
You've been a big help.
0
markg1Author Commented:
want theses points?
0
jbilCommented:
Sure, Thanks.


'can give appearance of allingning text
'put maskedit inside picture1

Option Explicit

Dim maskAllign As String
Private Sub Form_Load()
Picture1.FontSize = MaskEdBox1.Font.Size
Picture1.BackColor = MaskEdBox1.BackColor
MaskEdBox1.BorderStyle = mskNone
maskAllign = "center" 'or "left","right"
Picture1.Height = MaskEdBox1.Height
Picture1.Width = MaskEdBox1.Width
MaskEdBox1.Text = "" 
End Sub

Private Sub MaskEdBox1_Change()
Dim mywide
With MaskEdBox1
    mywide = Picture1.TextWidth(.Text & "   ")
    .Top = Picture1.ScaleTop
    .Width = mywide
End With

Select Case maskAllign
Case "center"
 MaskEdBox1.Left = Picture1.Width / 2 - MaskEdBox1.Width / 2

Case "right"
 MaskEdBox1.Left = (Picture1.Width - MaskEdBox1.Width)

Case "left"
 MaskEdBox1.Left = (Picture1.ScaleLeft)

End Select

End Sub

Private Sub Picture1_GotFocus()
MaskEdBox1.SetFocus
End Sub

 
 

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
markg1Author Commented:
thanks for all the time
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.