Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TextBox with first character uppercase

Status
Not open for further replies.

MontyItaly

Programmer
Feb 5, 2013
23
IT
In a normal TextBox I use InputMask "!XXXXXXX" for a field of 8 characters (First upper others lower).
In the fields of 30, 40 characters, Can I not use '! XXX .....' 40 times?.
Make a function or use MaxLengh or use NODEFAULT...

Thanks
Monty
 
I remember discussions resetting Selstart doesn't work well in all cases:

Code:
LOCAL nSelStart
nSelStart=this.SelStart 
* apply a change to .Value
this.SelStart=m.nSelStart

There were some corner cases which didn't worked well. It might be that was in conjunction with the change of .Value also changing it's length. But if it works, that's fine, of course. And TrueProper could be applied as the Value change, too.

Bye, Olaf.


 
There were some corner cases which didn't worked well. It might be that was in conjunction with the change of .Value also changing it's length.

That is correct. SetStart and SelLength reliably return the correct values, but I've often seen cases where changing the values doesn't work properly.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 

I have a doubt, if I use in Init of each field
THIS.InputMask = "!"+REPLICATE("X",Len(Eval(This.ControlSource))-1)
in VPN environment to read the ControlSource of 50-60 fields to slow down the loading of the form?

Monty
 
First: You don't need this with he more proper Proper() or TrueProper solutions. It would be contraproductive to use both.
Second: 60 fields * 100 chars per field, you talk about creating 6000 bytes of data "!"s and "X"es. That takes split seconds. What do you fear? And why don't you simply try it out? You can make a test form and see yourself.

Even if you take the solution with InteractiveChange, again what do you fear? VPN means the application itsef runs at the server side, local to the data, that could be on the same server where the central database is, ate least nearer than LAN clients are. What takes time is transferring the image of the form, and what does an input mask change in respect to the graphics? What? nothing! It only changes the behaviour of text you input to be uppered (via !) or kept as is (via X). That doesn't take time. We're talking about bytes in RAM. Do you know how fast RAM is?

Bye, Olaf.
 
I did a test using in Init of each field:
THIS.InputMask = "!"+REPLICATE("X",Len(Eval(This.ControlSource))-1) and
THIS.InputMask = REPLICATE("X",Len(Eval(This.ControlSource)))
not slows down the loading of the form. Nothing difference [thumbsup2]

Monty
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top