dgb
asked on
Usercontrol with maskedit
I've made an usercontrol on the basis of maskedEditBox.
Is there a way to pass all the functionality of the maskedEdit from the "inside" maskedEditbox to the "outside" of the usercontrol
without having to program all the functions and properties
Is there a way to pass all the functionality of the maskedEdit from the "inside" maskedEditbox to the "outside" of the usercontrol
without having to program all the functions and properties
I agree with Roger. Usually you wrap a different class to simplify the access methods, such as wrapping Windows API calls. If you are going to encapsulate a MaskedEdit box, then you are looking to limit access to all the functionality.
Bob
Bob
ASKER
Roger :
Can you explain it a bit more, maybe with a very small example
For now I've made an readonly property OrgObject wich passes the orginal maskedEditBox to the outside.
a bit of a workaround but it works.
Thanks
Can you explain it a bit more, maybe with a very small example
For now I've made an readonly property OrgObject wich passes the orginal maskedEditBox to the outside.
a bit of a workaround but it works.
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Roger,
It sounds like we are assuming 2005 and the MaskedTextBox, and it might be 2003 with the COM MaskEditBox control.
Bob
It sounds like we are assuming 2005 and the MaskedTextBox, and it might be 2003 with the COM MaskEditBox control.
Bob
Bob
True
Public Class MyMaskedEdit
Inherits AxMSMask.AxMaskEdBox
Public Sub setEuropeanDate()
Me.Mask = "99 ??? 9999"
Me.BackColor = Color.AliceBlue
Me.Focus()
End Sub
Public Sub setUSDate()
Me.Mask = "??? 99 9999"
Me.BackColor = Color.Bisque
Me.Focus()
End Sub
Public Sub clearMask()
Me.Mask = ""
Me.BackColor = Color.White
Me.Focus()
End Sub
End Class
Even more fatuous, but still illustrative ;-)
Roger
True
Public Class MyMaskedEdit
Inherits AxMSMask.AxMaskEdBox
Public Sub setEuropeanDate()
Me.Mask = "99 ??? 9999"
Me.BackColor = Color.AliceBlue
Me.Focus()
End Sub
Public Sub setUSDate()
Me.Mask = "??? 99 9999"
Me.BackColor = Color.Bisque
Me.Focus()
End Sub
Public Sub clearMask()
Me.Mask = ""
Me.BackColor = Color.White
Me.Focus()
End Sub
End Class
Even more fatuous, but still illustrative ;-)
Roger
ASKER
It's 2005 so the first example is oke.
Gone check it out, meanwhile i will reward the points.
Thanks.
Dirk
Gone check it out, meanwhile i will reward the points.
Thanks.
Dirk
What you might be able to do - although I do not know if this would meet your needs - is, rather than making a usercontrol based on the masked edit box, make your own class which inherits from the masked edit box. Then all the functions and properties of the base class would also be exposed in the inherited class.
Roger