-->

Wednesday, April 8, 2015

Use of CheckBox Control in windows store app

Use of CheckBox Control in windows store app

Desing Page


<Page
    x:Class="App1.checkBox"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:App1"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">



    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

        <CheckBox x:Name="check1" Content="MVC" HorizontalAlignment="Left" Margin="263,152,0,0" VerticalAlignment="Top" Height="45" Width="256" Checked="check1_Checked" />

        <CheckBox x:Name="check2" Content="ASP.NET" HorizontalAlignment="Left" Margin="263,81,0,0" VerticalAlignment="Top" Height="45" Width="256" Checked="check2_Checked_1" />
        <Button Content="Check " HorizontalAlignment="Left" Margin="242,287,0,0" VerticalAlignment="Top" Width="137" Click="Button_Click"/>

        <TextBlock  FontSize="20" x:Name="Label1" HorizontalAlignment="Left" Margin="387,84,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Height="113" Width="223"/>

    </Grid>
</Page>

// Code behind file


using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238

namespace App1
{
    /// <summary>
    /// An empty page that can be used on its own or navigated to within a Frame.
    /// </summary>
    public sealed partial class checkBox : Page
    {
        public checkBox()
        {
            this.InitializeComponent();
         
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            if (check1.IsChecked == true)
            {
                Label1.Text += check2.Content+"\n";
            }
            if (check2.IsChecked == true)
            {
                Label1.Text += check1.Content;
            }  
        }


        private void check2_Checked_1(object sender, RoutedEventArgs e)
        {

        }

        private void check1_Checked(object sender, RoutedEventArgs e)
        {

        }
    }
}

Code Generate the following output

Use of CheckBox Control in windows store app

Read other related articles

Also read other articles

© Copyright 2013 Computer Programming | All Right Reserved