quinta-feira, fevereiro 16, 2012

Calculadora C#

         Olá amigos, vou posta uma calculadora em c#, por enquanto é só o design da calculadora, depois estarei passando os códigos para fazer os cálculo, então vamos lá amigos.


Window x:Class="Calculadora02.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="351" Width="471">
    <Grid Width="453">
        <Rectangle Height="287" HorizontalAlignment="Left" Margin="120,12,0,0" Name="rectangle1" Stroke="Black" VerticalAlignment="Top" Width="323" Visibility="Visible" OpacityMask="Red" Fill="#1F4C524C" />
        <Rectangle Height="38" HorizontalAlignment="Left" Margin="120,11,0,0" Name="rectangle2" Stroke="Black" VerticalAlignment="Top" Width="323" OpacityMask="#FF9D859D">
            <Rectangle.Fill>
                <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
                    <GradientStop Color="Black" Offset="0" />
                    <GradientStop Color="#FFE6E9EF" Offset="1" />
                </LinearGradientBrush>
            </Rectangle.Fill>
        </Rectangle>
        <Label Content="Editar" Height="25" HorizontalAlignment="Left" Margin="128,54,0,0" Name="label1" VerticalAlignment="Top" Width="47" />
        <Label Content="Exibir" Height="25" HorizontalAlignment="Left" Margin="173,54,0,0" Name="label2" VerticalAlignment="Top" Width="47" />
        <Label Content="Ajuda" Height="25" HorizontalAlignment="Left" Margin="234,54,0,0" Name="label3" VerticalAlignment="Top" Width="47" />
        <TextBox Height="29" HorizontalAlignment="Left" Margin="129,78,0,0" Name="display" VerticalAlignment="Top" Width="306" Foreground="#FF1F348D" BorderBrush="#FF7184D1" TextAlignment="Right" />
        <Label Content="Calculadora" Height="28" HorizontalAlignment="Left" Margin="127,14,0,0" Name="label4" VerticalAlignment="Top" Width="141" Foreground="White" FontFamily="Cambria Math" FontSize="20" />
        <Button Content="BackSpace" Height="30" HorizontalAlignment="Left" Margin="207,113,0,0" Name="button1" VerticalAlignment="Top" Width="80" Foreground="Red" />
        <Button Content="C" Height="30" HorizontalAlignment="Left" Margin="370,113,0,0" Name="button3" VerticalAlignment="Top" Width="66" Foreground="Red" />
        <Button Content="MC" Height="30" HorizontalAlignment="Left" Margin="129,154,0,0" Name="button4" VerticalAlignment="Top" Width="46" Foreground="Red" />
        <Button Content="MR" Height="30" HorizontalAlignment="Left" Margin="129,190,0,0" Name="button5" VerticalAlignment="Top" Width="46" Foreground="Red" />
        <Button Content="MS" Height="30" HorizontalAlignment="Left" Margin="129,226,0,0" Name="button6" VerticalAlignment="Top" Width="46" Foreground="Red" />
        <Button Content="M+" Height="30" HorizontalAlignment="Left" Margin="129,262,0,0" Name="button7" VerticalAlignment="Top" Width="46" Foreground="Red" />
        <Button Content="4" HorizontalAlignment="Left" Margin="182,189,0,92" Name="button8" Width="46" OpacityMask="#FF000FEF" Foreground="#FF000AFF" Click="button8_Click" />
        <Button Content="1" Height="30" HorizontalAlignment="Left" Margin="182,227,0,0" Name="button9" VerticalAlignment="Top" Width="46" Foreground="#FF000EFF" Click="button9_Click" />
        <Button Content="7" Height="30" HorizontalAlignment="Left" Margin="182,154,0,0" Name="button12" VerticalAlignment="Top" Width="46" Foreground="#FF0013FF" OpacityMask="#FF000B9A" Click="button12_Click" />
        <Button Content="0" Height="30" HorizontalAlignment="Left" Margin="182,262,0,0" Name="button13" VerticalAlignment="Top" Width="46" Foreground="#FF0011FF" Click="button13_Click" />
        <Button Content="8" Height="30" HorizontalAlignment="Left" Margin="235,154,0,0" Name="button14" VerticalAlignment="Top" Width="46" Foreground="#FF000DFF" Click="button14_Click" />
        <Button Content="5" Height="31" HorizontalAlignment="Right" Margin="0,190,173,0" Name="button10" VerticalAlignment="Top" Width="46" Foreground="#FF0009FF" Click="button10_Click" />
        <Button Content="2" Height="30" HorizontalAlignment="Left" Margin="235,226,0,0" Name="button11" VerticalAlignment="Top" Width="46" Foreground="#FF0008FF" Click="button11_Click" />
        <Button Content="+/-" Height="30" HorizontalAlignment="Left" Margin="235,262,0,0" Name="button15" VerticalAlignment="Top" Width="46" Foreground="#FF000DFF" />
        <Button Content="9" Height="30" HorizontalAlignment="Left" Margin="287,154,0,0" Name="button16" VerticalAlignment="Top" Width="46" Foreground="#FF000FFF" Click="button16_Click" />
        <Button Content="6" Height="30" HorizontalAlignment="Left" Margin="287,190,0,0" Name="button17" VerticalAlignment="Top" Width="46" Foreground="#FF0012FF" Click="button17_Click" />
        <Button Content="3" Height="30" HorizontalAlignment="Left" Margin="287,226,0,0" Name="button18" VerticalAlignment="Top" Width="46" Foreground="#FF0017FF" Click="button18_Click" />
        <Button Content="," Height="30" HorizontalAlignment="Left" Margin="287,262,0,0" Name="button19" VerticalAlignment="Top" Width="46" Foreground="#FF0014FF" />
        <Button Content="/" Height="30" HorizontalAlignment="Left" Margin="338,154,0,0" Name="button20" VerticalAlignment="Top" Width="46" Foreground="Red" />
        <Button Content="*" Height="30" HorizontalAlignment="Left" Margin="338,190,0,0" Name="button21" VerticalAlignment="Top" Width="46" Foreground="Red" />
        <Button Content="-" Height="30" HorizontalAlignment="Left" Margin="338,226,0,0" Name="button22" VerticalAlignment="Top" Width="46" Foreground="Red" />
        <Button Content="+" Height="30" HorizontalAlignment="Left" Margin="338,262,0,0" Name="button23" VerticalAlignment="Top" Width="46" Foreground="Red" />
        <Button Content="sqrt" Height="30" HorizontalAlignment="Left" Margin="390,154,0,0" Name="button24" VerticalAlignment="Top" Width="46" Foreground="#FF0014FF" />
        <Button Content="%" Height="30" HorizontalAlignment="Left" Margin="390,190,0,0" Name="button25" VerticalAlignment="Top" Width="46" Foreground="#FF0018FF" />
        <Button Content="1/x" Height="30" HorizontalAlignment="Left" Margin="390,226,0,0" Name="button26" VerticalAlignment="Top" Width="46" Foreground="#FF0017FF" />
        <Button Content="=" Height="30" HorizontalAlignment="Left" Margin="390,262,0,0" Name="button27" VerticalAlignment="Top" Width="46" Foreground="Red" />
        <Button Content="CE" Height="30" HorizontalAlignment="Left" Margin="297,113,0,0" Name="button2" VerticalAlignment="Top" Width="66" Foreground="Red" />
        <Button Content="X" Height="29" HorizontalAlignment="Left" Margin="407,15,0,0" Name="button28" VerticalAlignment="Top" Width="32" OpacityMask="Black" BorderBrush="Black" Foreground="Red" />
        <Button Content="[]" Height="29" HorizontalAlignment="Left" Margin="370,15,0,0" Name="button29" VerticalAlignment="Top" Width="32" Foreground="Red" BorderBrush="Black" OpacityMask="Black" />
        <Button Content="-" Height="29" HorizontalAlignment="Left" Margin="332,15,0,0" Name="button30" VerticalAlignment="Top" Width="32" OpacityMask="Black" Foreground="Red" BorderBrush="Black" />
    </Grid>
</Window>

            Este é só o código para o design da calculadora, depois estarei postando os códigos para podermos efetuar os cálculos, então até a próxima.

Nenhum comentário:

Postar um comentário