1/12/2012

Web Services


Web Services:
It is a communication between two applications over the internet. The web service can be used via Internet or a Cloud. It may  be stated that web service has helped in blurting the line between thin clients and thick clients. The functionalities that earlier considered apt to only websites, can now be used by a desktop client.

1/11/2012

percentage of change in C# windows Form Application

 

Percentage Of Change Calculator C# Windows Form
Percentage Of Change Calculator in C# Windows Form



 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System;
using System.Windows.Forms;

namespace PercentageOfChangeCalculator
{
    public partial class MainForm : Form
    {
        double initial, final;
        public frmPercentageOfChangeCalculator()
        {
            InitializeComponent();
        }

        private void clearButton_Click(object sender, EventArgs e)
        {
            initialValueTextBox.Clear();
            finalValueTextBox.Clear();
            initialValueTextBox.Focus();
            resultLabel.Text = null;
        }

        private void calculateButton_Click(object sender, EventArgs e)
        {
            if (double.TryParse(initialValueTextBox.Text, out initial) && double.TryParse(finalValueTextBox.Text, out final))
            {
                double percentage = ((final - initial) / initial) * 100;
                resultLabel.Text = $"Percentage of change: {percentage}%";
            }
            else
            {
                MessageBox.Show("Please enter valid numeric values for initial and final values.");
            }
        }
    }
}