Print Friendly and PDF
Digital Extraction in C# using Gui Programming Input maximum 5 integer and extract and print separately as shown below.
Input maximum 5 integer and extract and print separately as shown below.



Program

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Question2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            string a;
            a = textBox1.Text;
            if (textBox1.TextLength >= 6)
            {
                button2.Text = a.Substring(0, 1);
                button3.Text = a.Substring(1, 1);
                button4.Text = a.Substring(2, 1);
                button5.Text = a.Substring(3, 1);
                button6.Text = a.Substring(4, 1);
                button7.Text = a.Substring(5, 1);
            }
            else
            {
                MessageBox.Show("Enter Minimum 6 Characters");
                textBox1.Clear();
            }
        }

        private void button8_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }
    }
}
zubairsaif

Zubair saif

A passionate writer who loves to write on new technology and programming

Post A Comment:

0 comments: