Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Property Grid
  New Posts New Posts RSS Feed - setmask
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

setmask

 Post Reply Post Reply
Author
Message
wakerunner View Drop Down
Groupie
Groupie


Joined: 29 September 2007
Status: Offline
Points: 85
Post Options Post Options   Thanks (0) Thanks(0)   Quote wakerunner Quote  Post ReplyReply Direct Link To This Post Topic: setmask
    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.
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 12 February 2008 at 11:49am
.0000 already limits it to only 0-9
Back to Top
wakerunner View Drop Down
Groupie
Groupie


Joined: 29 September 2007
Status: Offline
Points: 85
Post Options Post Options   Thanks (0) Thanks(0)   Quote wakerunner Quote  Post ReplyReply Direct Link To This Post 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.
 
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
wakerunner View Drop Down
Groupie
Groupie


Joined: 29 September 2007
Status: Offline
Points: 85
Post Options Post Options   Thanks (0) Thanks(0)   Quote wakerunner Quote  Post ReplyReply Direct Link To This Post 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.
 
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post 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
 
 
 
or
 
 
 
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.