[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 548
  • Last Modified:

maskedbox

Does the MaskEdBox have an alignment property?
0
markg1
Asked:
markg1
  • 5
  • 2
  • 2
  • +1
1 Solution
 
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 new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
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
 
markg1Author Commented:
thanks for all the time
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 5
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now