Silverlight Kayıt Formu uygulaması
Silverlight Kayıt Formu uygulaması. Herhangi bir alan boş bırakılmış ise Gönder butonuna tıklandığında boş olan alanların yanlarına kırmızı renkli Lütfen şu alanı boş bırakmayınız şeklinde uyarı mesajı veriyor.
Uygulamanın MainPage.xaml dosyasının kodu:
<UserControl x:Class="KayitFormu.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"> <Grid x:Name="LayoutRoot" Background="White"> <Canvas Height="276" HorizontalAlignment="Left" Margin="12,12,0,0" Name="canvas1" VerticalAlignment="Top" Width="354"> <TextBox Canvas.Left="96" Canvas.Top="16" Height="23" Name="textBox1" Width="120" /> <TextBox Canvas.Left="96" Canvas.Top="45" Height="23" Name="textBox2" Width="120" /> <TextBox Canvas.Left="96" Canvas.Top="74" Height="23" Name="textBox3" Width="120" /> <TextBox Canvas.Left="96" Canvas.Top="103" Height="23" Name="textBox4" Width="120" /> <TextBox Canvas.Left="96" Canvas.Top="132" Height="23" Name="textBox5" Width="120" /> <TextBox Canvas.Left="96" Canvas.Top="161" Height="23" Name="textBox6" Width="120" /> <sdk:Label Canvas.Left="0" Canvas.Top="16" Height="23" Name="label1" Width="75" Content="Tc Kimlik No:" /> <sdk:Label Canvas.Left="0" Canvas.Top="40" Height="28" Name="label2" Width="90" Content="Adı:" /> <sdk:Label Canvas.Left="0" Canvas.Top="69" Height="28" Name="label3" Width="90" Content="Soyadı:" /> <sdk:Label Canvas.Left="0" Canvas.Top="98" Height="28" Name="label4" Width="90" Content="Telefonu:" /> <sdk:Label Canvas.Left="0" Canvas.Top="127" Height="28" Name="label5" Width="90" Content="Mail Adresi:" /> <sdk:Label Canvas.Left="0" Canvas.Top="156" Height="28" Name="label6" Width="90" Content="Web Sitesi" /> <Button Canvas.Left="41" Canvas.Top="233" Content="Temizle" Height="23" Name="button1" Width="75" Click="button1_Click" /> <Button Canvas.Left="141" Canvas.Top="233" Content="Gönder" Height="23" Name="button2" Width="75" Click="button2_Click" /> <TextBlock Canvas.Left="96" Canvas.Top="204" Height="23" Name="Sonuc" Text="" /> <TextBlock Canvas.Left="233" Canvas.Top="16" Height="23" Name="Tc" Text="" Width="71" /> <TextBlock Canvas.Left="233" Canvas.Top="46" Height="23" Name="Ad" Text="" Width="71" /> <TextBlock Canvas.Left="233" Canvas.Top="78" Height="23" Name="Soyad" Text="" Width="71" /> <TextBlock Canvas.Left="233" Canvas.Top="104" Height="23" Name="Telefon" Text="" Width="71" /> <TextBlock Canvas.Left="233" Canvas.Top="133" Height="23" Name="Mail" Text="" Width="71" /> <TextBlock Canvas.Left="233" Canvas.Top="161" Height="23" Name="Web" Text="" Width="71" /> </Canvas> </Grid> </UserControl>
Uygulamanın MainPage.xaml.cs dosyasının kodu:
private void button2_Click(object sender, RoutedEventArgs e) { if (textBox1.Text=="") { Tc.Text = "Lütfen Tc Kimlik No Giriniz"; Sonuc.Text = "Lütfen Tüm Bilgileri Doğru Giriniz"; Tc.Foreground = new SolidColorBrush(Colors.Red); Sonuc.Foreground = new SolidColorBrush(Colors.Red); } if (textBox2.Text=="") { Ad.Text = "Lütfen Adınızı Giriniz."; Sonuc.Text = "Lütfen Tüm Bilgileri Doğru Giriniz"; Ad.Foreground = new SolidColorBrush(Colors.Red); Sonuc.Foreground = new SolidColorBrush(Colors.Red); } if (textBox3.Text == "") { Soyad.Text = "Lütfen Soyadınızı Giriniz."; Sonuc.Text = "Lütfen Tüm Bilgileri Doğru Giriniz"; Soyad.Foreground = new SolidColorBrush(Colors.Red); Sonuc.Foreground = new SolidColorBrush(Colors.Red); } if (textBox4.Text == "") { Telefon.Text = "Lütfen Telefonunuzu Giriniz."; Sonuc.Text = "Lütfen Tüm Bilgileri Doğru Giriniz"; Telefon.Foreground = new SolidColorBrush(Colors.Red); Sonuc.Foreground = new SolidColorBrush(Colors.Red); } if (textBox5.Text == "") { Mail.Text = "Lütfen Mail Adresinizi Giriniz."; Sonuc.Text = "Lütfen Tüm Bilgileri Doğru Giriniz"; Mail.Foreground = new SolidColorBrush(Colors.Red); Sonuc.Foreground = new SolidColorBrush(Colors.Red); } if (textBox6.Text == "") { Web.Text = "Lütfen Web Sitenizi Giriniz."; Sonuc.Text = "Lütfen Tüm Bilgileri Doğru Giriniz"; Web.Foreground = new SolidColorBrush(Colors.Red); Sonuc.Foreground = new SolidColorBrush(Colors.Red); } if ((textBox1.Text!="")&&(textBox2.Text!="")&& (textBox3.Text!="")&&(textBox4.Text!="")&& (textBox5.Text!="")&&(textBox6.Text!="")) { Sonuc.Text = "Tebrikler Tüm Bilgileri Doğru Girdiniz."; Sonuc.Foreground = new SolidColorBrush(Colors.Green); Tc.Text = ""; Ad.Text = ""; Soyad.Text = ""; Telefon.Text = ""; Mail.Text = ""; Web.Text = ""; } } private void button1_Click(object sender, RoutedEventArgs e) { textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = ""; textBox4.Text = ""; textBox5.Text = ""; textBox6.Text = ""; Tc.Text = ""; Ad.Text = ""; Soyad.Text = ""; Telefon.Text = ""; Mail.Text = ""; Web.Text = ""; Sonuc.Text = ""; }
Uugulamanın ekran görüntüleri
Tüm alanlar doğru girildiğinde yani doldurulduğu zaman Alt tarafa yeşil renkli Tebrikler tüm alanları doğru girdiniz şeklinde mesaj yazıyor.
Bu Yazıya Tepkin Nedir?
+1
+1
+1
+1
+1
+1
+1
<< Önceki Yazı
Sonraki Yazı >>
Silverlight, silverlight dersleri, Silverlight Kayıt Formu uygulaması, silverlight kodları, silverlight kullanımı, silverlight örnek kodları, silverlight örnek uygulamaları, silverlight örnekleri, silverlight uygulamaları