3
Contributors
7
Replies
8
Views
9 Years
Discussion Span
Last Post by LizR
0

OK the numbers only issue:

Your reg expression of \d is why, you need to include commas and dots.

for the "dont show this again" in the onchecked you set a registry (or ini file) setting to stop this, and when its missing or false, you show the message, when its true, you dont.

0

A couple of pointers;

Firstly regarding the limitation of button presses in your textbox. I would do this in javascript, that way you will not do a postback everytime a button is clicked.

In javascript you can use event.keyCode; to get the value of the key pressed. If the key id is not valid return false; (See http://www.geekpedia.com/tutorial138_Get-key-press-event-using-JavaScript.html)

Regarding the second problem. You are going to have to persist the form status on the user's machine. When the application loads check the current form status if enabled, open the form, if disabled don't open it. Have a look at User and System Properties in .NET.

0

I dont believe the OP is using webforms, but winforms, in whcih case javascript wouldnt be the way

0

Yes, your correct LizR.

1. I don't have any knowledge in Java ( not that i have much in CSharp either).
(I could always learn but rather not at the moment.)

2. I'm using a Windows Form Application Method.

3. I'll most defnitally look in the User, and System Properties of the .NET

0

Ok I've done some reading and I believe I understand how to tackle the "Don't Show again" item, but I am still having issues with the textbox.

My question (directed at LizR) is what parameters may I substitute the "\d" for?
I had copied this line of code from a snippet here on this site. I'm not sure what parameters their are for the Regex namespace.

Code ::

if 
(!System.Text.RegularExpressions.Regex.IsMatch(e.KeyChar.ToString(), "\\d+"))
e.Handled = true;

** Off Topic **
What is the Rep Power for next to some posting info?

0

Have a read of regular expressions - its not hugely a complicated as a subject, but its power is astronmic, I couldnt do it justice in a post..

As for rep power, you may notice you can "add to "someones rep, the rep power is how much influence they have if they do that

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.