|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Please explainI am having trouble understanding how to use different properties. For
example, I have a maskedtext box on a form. Lets call it msk1. I want to remove the mask from msk1. I figured out to do the following: msk1.textMaskFormat=maskFormat.ExcludePromptAndLiterals However, I don't understand why the following doesn't work. msk1.textMaskFormat.ExcludePromptAndLiterals To put it simply, I am having trouble understanding how to use a lot of the properties or methods. Could somebody please explain or give me a link to documentation that explains what I am asking? Please don't say buy a book. I have looked at different books, but obviously not clueing into this information. Therefore, I wouldn't know exactly what to read again. Thank you John wrote:
> I am having trouble understanding how to use different properties. For First place to start is the docs. The docs for the textMaskFormat> example, I have a maskedtext box on a form. Lets call it msk1. I want to > remove the mask from msk1. I figured out to do the following: > msk1.textMaskFormat=maskFormat.ExcludePromptAndLiterals > > However, I don't understand why the following doesn't work. > msk1.textMaskFormat.ExcludePromptAndLiterals > > To put it simply, I am having trouble understanding how to use a lot of the > properties or methods. property of a MaskedTextBox say: Public Property TextMaskFormat As MaskFormat So we see that TextMaskFormat is a property that has a value of type MaskFormat. Following the link we see that MaskFormat is an Enum that has various values. Assuming you have a correct conceptual understanding of what properties and enums are, it's hard to know what to say next. We have a property; we want to change the value of that property; so we use an assignment statement to set the value of the property to the value we want it to have. Maybe it would help to think of Enums as 'magic numbers with names' ? As it happens MaskFormat.ExcludePromptAndLiterals 'is' just the number zero, with a special name. If we didn't have this Enum available, we would have to do something like msk1.TextMaskFormat = 0 in which presumably its more obvious what's happening? We are urged to avoid magic numbers in our code, and predefined Enums are in this situation just a way of enforcing that. -- Larry Lard Replies to group please
At a loss figuring out if an IP is on LAN or INET
update form background color DWORDS ? LONG? - I need to create constants for the following Function call problem How to Obsolete two related classes? Calling PaintBox Paint event Invalid Cast Errors Datagrid, binded columns and unbinded columns Can't open a project by iteself? Solution opens every time! Invoking apps within VB |
|||||||||||||||||||||||