|
-
February 13th, 2005, 12:21 PM
#1
-
February 13th, 2005, 01:20 PM
#2
Re: how to close a form
To close a form, use this.Close() in the close button's OnClick function
Code:
void btnClose(object sender, System.EventArgs e)
{
this.Close();
}
You can use regex to check if there are any uppercase and/or lowecase characters in the string.
Code:
Match m = Regex.Match(str, @"^[A-Z]+$");
if(m.Success)
...
The above will check if the entire string is in uppercase. For "[A-Z]+" , m.Success will be true if there is atleast one uppercase character in the string. Use whichever suits your needs.
To combine the two statements, you can use
Code:
if(Regex.Match(str, @"^[A-Z]+$").Success)
...;
The ^ and $ mean the beginning and end of the string respectively. + means one or more of the previous characters, * would mean 0 or more occurrences of the previous characters, just in case you don't know regular expressions. There might be a simpler way, but this is the only way I know, I too am a newbie in C# 
Regex is defined in System.Text.RegularExpressions, so don't forget to include this namespace.
Last edited by BigEvil; February 13th, 2005 at 01:25 PM.
-
February 14th, 2005, 11:46 AM
#3
Re: how to close a form
thanx dear,
i'll try both of them
thanx again
A small First step is the begining of any giant leap
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|