|
Congratulations on getting a hobby! Now, did you have an actual question?
|
|
|
|
|
What is your question please?
|
|
|
|
|
Dave's question was whether the OP had a.... oh nevermind
|
|
|
|
|
|
Why would I be asking a question??
I certainly wouldn't be asking you about it.
You can't even reply to the correct post.
|
|
|
|
|
|
You can't seem to hit Reply to the correct post.
|
|
|
|
|
I'm afraid you'll have to answer him in Thai if you expect him to understand subtle remarks.
You do know Thai well enough to write coherently don't you?
|
|
|
|
|
I want a textbox for a phone number. I want the text box to have this format
( ) - embedded inside it. When some one inputs the phone number the first three numbers (area code) should automatically fit in the bracket area and the next three before the hyphen and the last four after the hyphen (without the user having to type the bracket or the hyphen. I have no idea how to approach the problem.
Pl help
|
|
|
|
|
Search your online help for "maskedit". There will be a ready-made one for phone numbers along with several other useful ones.
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
I found many which would format the phone number after it has been entered, but I could not find any where the bracket and the hyphen were already embedded in the textbox when it loads.
If you can direct me to one it would be great.
|
|
|
|
|
This one[^] is for dates in VB, but I am sure you can do the obvious translation. (I don't have C# or VS here, so I'm poking around in the dark a bit.) The main point is that the underlying MaskedEdit control takes care of displaying the extra bits as well as controlling what can be entered.
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
The masked textbox did the trick, the only problem was that it shows those ugly looking lines
(___)___-____
is there a way to get rid of the lines and it just displays
( ) -
but works the way the masked textbox worked. I tried providing my own mask as well, but the lines in the textbox will not go.
|
|
|
|
|
You can override the textbox class and make your own masked textbox.
I don't think you can remove the lines. (maybe in the onpaint event or something?)
V.
|
|
|
|
|
The "lines" are underscore characters. In the corresponding Borland VCL control, you can change the character, but I don't know whether this happens in the Borland wrapper or the underlying MS control.
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
I know what "underscores" are, thank you
V.
|
|
|
|
|
humayunlalzad wrote: is there a way to get rid of the lines and it just displays
Simples! Just set the PromptChar property to space.
Did you know:
That by counting the rings on a tree trunk, you can tell how many other trees it has slept with.
|
|
|
|
|
Great! I was pretty sure it was in there somewhere.
btw 5'd you to make up for the CCC I pinched from you a couple of weeks ago. Been meaning to do so; just found somewhere to do it!
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
I don't remember it! Thanks anyway.
Did you know:
That by counting the rings on a tree trunk, you can tell how many other trees it has slept with.
|
|
|
|
|
Thanks a lot
That was so simple, that it got overlooked
|
|
|
|
|
I've written some code that the VS designer is griping about. Isn't there a flag that I can use to make the designer ignore it?
The mind is like a parachute. It doesn’t work unless it’s open.
|
|
|
|
|
Hi Richard,
there is the Control.DesignMode property that could be useful.
|
|
|
|
|
I hate easy answers!
I've been digging around for a reserved word. (I feel like saying some "reserved" words)
The mind is like a parachute. It doesn’t work unless it’s open.
|
|
|
|
|
Yes, sometimes all you need to do is open your parachute aka MSDN...
|
|
|
|
|
Sometimes I just hanging on by the emergency chute!
(I hate MSDN by the way. I can find info much easier through google)
The mind is like a parachute. It doesn’t work unless it’s open.
|
|
|
|