Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
C#
namespace userregistration
{    
    public class Service1 : IService1
    {
        XmlDocument xdoc;
        XmlNode root;
        XmlNode xn;
        public string ufname;
        public string ulname;
        public string uemail;
        public string upass;
        public string uconfpass;
        public string uadd;
        public bool firstnameinput(string fnametext)
         {
            if (fnametext == "")
             {
                   return true;
             }
             else
               {
                   return false;
               }

         }
    }
  }

C#
void validation()
  {
      fnametext = textboxFirstName.Text;
      lnametext = textboxlastname.Text;
      emailtext = textboxEmail.Text;
      passtext = password.Password;
      confpasstext = confpass.Password;
      addtext = addtexbox.Text;
      ServiceReference1.Service1Client input = new ServiceReference1.Service1Client();
      if (input.firstnameinput(fnametext))
      {
           textboxFirstName.ToolTip= "Enter Your First Name";
          // the tooltip message bind with text box........how to do this
      }
      else if (input.lastnameinput(lnametext))
      {
          MessageBox.Show("Enter Your Last Name");
      }
    
  }


XML
<pre lang="HTML">

<Window x:Class="Registration_Form1.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">
    <Grid Margin="22,0,25,15" removed="#FFC3A1AC" Height="283" VerticalAlignment="Bottom">
        <Button Content="SUBMIT" Margin="62,240,318,20" x:Name="Submitbtn" Foreground="#FFEC4AA9" Click="Submitbtn_Click"/>
        <Label Content="Regestration Form"  Margin="153,10,172,244" Foreground="#FFEC4AA9" FontWeight="Bold" FontStyle="Italic" FontSize="14" />
        <Label Content="First Name:"  Margin="37,56,326,204" Foreground="#FFEC4AA9" />
        <Label Content="Last Name:"  Margin="37,88,326,172" Foreground="#FFEC4AA9"  />
        <Label Content="Email ID:"  Margin="37,116,326,144" Foreground="#FFEC4AA9"  />
        <Label Content="Password:"  Margin="37,144,326,116" Foreground="#FFEC4AA9" />
        <Label Content="Confirm Password:"  Margin="37,172,326,88" Foreground="#FFEC4AA9" />
        <Label Content="Address:"  Margin="37,205,326,55" Foreground="#FFEC4AA9" />
        <TextBox  Margin="155,56,70,204" x:Name="textboxFirstName" Foreground="#FFEC4AA9"/>
        <TextBox  Margin="155,87,70,173" x:Name="textboxlastname" Foreground="#FFEC4AA9" />
        <TextBox  Margin="155,116,70,144" x:Name="textboxEmail" RenderTransformOrigin="0.323,-2.08" Foreground="#FFEC4AA9" />
        <PasswordBox  Margin="155,144,70,116" x:Name="password" Foreground="#FFEC4AA9" />
        <!--For password-->
        <PasswordBox  Margin="155,172,70,88" x:Name="confpass" Foreground="#FFEC4AA9" />
        <TextBox Margin="155,205,70,55" x:Name="addtexbox" Foreground="#FFEC4AA9" />
        <Button Content="RESET"  Margin="182,240,192,20" x:Name="resetbtn" Foreground="#FFEC4AA9" Click="resetbtn_Click"/>
        <Button Content="CANCEL"  Margin="308,240,50,20" x:Name="cancelbtn" Foreground="#FFEC4AA9" Click="cancelbtn_Click" />
        <TextBlock Name="message" Margin="62,115,50,135" FontWeight="Bold" FontStyle="Italic" FontSize="18"/>
    </Grid>
</Window>
Posted
Updated 11-Mar-15 6:38am
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900