Print Page | Close Window

setmask

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Property Grid
Forum Description: Topics Related to Codejock Property Grid
URL: http://forum.codejock.com/forum_posts.asp?TID=9556
Printed Date: 22 May 2025 at 10:32am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: setmask
Posted By: wakerunner
Subject: setmask
Date Posted: 11 February 2008 at 1:05pm

I'm having problems with the setmask.

 
Set Item = category.AddChildItem(PropertyItemString, "Setting Name")
Item.SetMask ".0000", ".____"
item.id=4
 
PG4.FindItem(4).Value = ".07"
 
The code above displays the property grid with the .07 in the value, then when you click on the value it changes it to ".____"
 
I am using this wrong? I am simply trying to limit the values that can be typed in. Is there a better way? There should be a "legal characters" property where you could simply set to ".0123456789" etc. for the characters it is legal to accept.



Replies:
Posted By: SuperMario
Date Posted: 12 February 2008 at 11:49am
.0000 already limits it to only 0-9


Posted By: wakerunner
Date Posted: 12 February 2008 at 11:54am
Yes I know that, but you didn't answer either question.
 
Question 1 Why does Setmask ".0000", ".____" change the vale ".07" to ".____" when you click on that value?
 
2nd Question, Is there another way of limiting input such as setting legal characters without using the setmask. If the setmask worked I guess it would be OK to use but as I said above either I am using it wrong or it does not work.
 


Posted By: Aaron
Date Posted: 19 February 2008 at 10:03am

Hi,

When you use SetMask you have to fill the entire field. In your case you have to set the value to .0007 in this case the propertygriditem does accept the value. Normally I would accept this behaviour because we won't accept wrong values the user would enter, right?
 
But: I found something else,
 
Set Item = Category.AddChildItem(PropertyItemString, "Number", "Number: .00.7")
    Item.SetMask "Currency: .0000", "Number: .____"
 
When setting a value (sample above) to a PropertyGridItem, this value will be accepted  .00.7  (notice the dot). This is strange ???
 
Your value .07 won't be accepted and this will . But we probably are doing something wrong  Let's find out and listen to the master.
 
By the way, did you ever see a underscore in a IP address? I guess not


Posted By: wakerunner
Date Posted: 19 February 2008 at 11:19am
It doesn't look like the master is going to reply to this thread.
 
It seems to me the setmask is very dysfunctional and does all kinds of weird things. It could be useful when you know the exact format that is needed such as a phone number.
 
There should be a "legalcharacters" property that you could set as follows:
 
propertygriditem.legalcharacters=".0123456789"
 
That would be useful for when you want to limit input but don't care about the exact format.
 


Posted By: Aaron
Date Posted: 28 March 2008 at 10:07am
Hi wakerunner
 
I think we are doing something wrong. I was strugling with the IP address item and I gave up. Check my post I did earlier
 
 
http://forum.codejock.com/forum_posts.asp?TID=9966 - http://forum.codejock.com/forum_posts.asp?TID=9966
 
or
 
http://forum.codejock.com/forum_posts.asp?TID=9944 - http://forum.codejock.com/forum_posts.asp?TID=9944
 
 



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net