본문 바로가기

Programing (프로그래밍)/WPF & C# (C Sharp)

WPF & C# - struct 구조체

728x90
반응형
 WPF & C# - struct 구조체 

StructTest.zip
0.04MB
StructTest.exe
0.01MB

 

<StackPanel>
    <Button Height="30" Click="Button_Click"></Button>
    <Label Height="25" x:Name="lbl01"></Label>
    <Label Height="25" x:Name="lbl02"></Label>
    <Label Height="25" x:Name="lbl03"></Label>
</StackPanel>

 

struct Test
{
    public int x;
    public int y;
    public int z;
}

private void Button_Click(object sender, RoutedEventArgs e)
{
    Test a = new Test();

    a.x = 1;
    a.y = 2;
    a.z = 3;

    lbl01.Content = a.x;
    lbl02.Content = a.y;
    lbl03.Content = a.z;
}

 

728x90
반응형