Click here to Skip to main content
15,888,000 members
Home / Discussions / C#
   

C#

 
GeneralRe: Generics question Pin
Pete Burkindine15-Aug-10 4:01
Pete Burkindine15-Aug-10 4:01 
GeneralRe: Generics question Pin
PIEBALDconsult15-Aug-10 7:16
mvePIEBALDconsult15-Aug-10 7:16 
GeneralRe: Generics question Pin
PIEBALDconsult15-Aug-10 7:28
mvePIEBALDconsult15-Aug-10 7:28 
GeneralRe: Generics question Pin
PIEBALDconsult15-Aug-10 7:57
mvePIEBALDconsult15-Aug-10 7:57 
GeneralRe: Generics question Pin
Pete Burkindine15-Aug-10 9:01
Pete Burkindine15-Aug-10 9:01 
AnswerRe: Generics question Pin
PIEBALDconsult14-Aug-10 15:32
mvePIEBALDconsult14-Aug-10 15:32 
AnswerProposed Solutions [modified] Pin
Pete Burkindine14-Aug-10 17:38
Pete Burkindine14-Aug-10 17:38 
QuestionUser Control Pin
humayunlalzad14-Aug-10 8:50
humayunlalzad14-Aug-10 8:50 
I am creating a user control which will work as a Telephone number validator.
I want that when Regex is not a match the Text property should not return any kind of string. Can someone help with the code, as with my code, the errorprovider is instantiated but it still continues and returns the invalid phone number
public override  string  Text
        {
            get {
                string phone = textBox1.Text.Trim() + textBox2.Text.Trim() + textBox3.Text.Trim();
                if (!Regex.IsMatch(phone, @"^\d{9}$"))
                {
                    errorProvider1.SetError(textBox3, "Please provide a valid phone number");
                    errorProvider1.SetIconAlignment(textBox3, ErrorIconAlignment.MiddleRight);
                    
                    
                }
                
                return phone;
            }
            set {
                string phone;
                
                phone = value;
                textBox1.Text = phone.Substring(0, 3);
                textBox2.Text = phone.Substring(3, 3);
                textBox3.Text = phone.Substring(6);
            }
        }

AnswerRe: User Control Pin
Luc Pattyn14-Aug-10 8:55
sitebuilderLuc Pattyn14-Aug-10 8:55 
AnswerRe: User Control Pin
OriginalGriff14-Aug-10 9:30
mveOriginalGriff14-Aug-10 9:30 
GeneralRe: User Control Pin
humayunlalzad15-Aug-10 5:05
humayunlalzad15-Aug-10 5:05 
Questionoutlook folder Pin
michaelgr114-Aug-10 4:46
michaelgr114-Aug-10 4:46 
Questiondatat base program user odbc driver in C# .net Pin
DKRAUT14-Aug-10 4:02
DKRAUT14-Aug-10 4:02 
AnswerRe: datat base program user odbc driver in C# .net Pin
Dan Mos14-Aug-10 4:07
Dan Mos14-Aug-10 4:07 
AnswerRe: datat base program user odbc driver in C# .net Pin
Eddy Vluggen14-Aug-10 4:22
professionalEddy Vluggen14-Aug-10 4:22 
Questioncant create an xml file Pin
igalep13214-Aug-10 0:18
igalep13214-Aug-10 0:18 
AnswerRe: cant create an xml file Pin
Abhishek Sur14-Aug-10 0:30
professionalAbhishek Sur14-Aug-10 0:30 
GeneralRe: cant create an xml file Pin
igalep13214-Aug-10 0:40
igalep13214-Aug-10 0:40 
AnswerRe: cant create an xml file Pin
PIEBALDconsult14-Aug-10 5:28
mvePIEBALDconsult14-Aug-10 5:28 
Questionhighlighting the row of the access database Pin
swtlibra13-Aug-10 21:31
swtlibra13-Aug-10 21:31 
AnswerRe: highlighting the row of the access database Pin
Roger Wright13-Aug-10 22:25
professionalRoger Wright13-Aug-10 22:25 
AnswerRe: highlighting the row of the access database Pin
Luc Pattyn13-Aug-10 22:44
sitebuilderLuc Pattyn13-Aug-10 22:44 
QuestionHierachy Grid from Objects Pin
Vimalsoft(Pty) Ltd13-Aug-10 20:51
professionalVimalsoft(Pty) Ltd13-Aug-10 20:51 
QuestionMessage Removed Pin
13-Aug-10 13:06
yum 201013-Aug-10 13:06 
AnswerRe: sever is not displaying the content that " you have left the chat room".... Pin
OriginalGriff13-Aug-10 23:06
mveOriginalGriff13-Aug-10 23:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.