Last active
March 12, 2017 17:00
-
-
Save YSRKEN/cfb09147b909c14dd0583fa7c57d8841 to your computer and use it in GitHub Desktop.
WPFにおけるGUI構築講座 -座標ベタ書きから脱却しよう- ref: http://qiita.com/YSRKEN/items/686068a359866f21f956
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Window x:Class="WpfApplication1.MainWindow" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
xmlns:local="clr-namespace:WpfApplication1" | |
mc:Ignorable="d" | |
Title="MainWindow" Height="170" Width="300"> | |
<Grid> | |
<TextBox x:Name="AddLeftTextBox" HorizontalAlignment="Left" Height="23" Margin="14,18,0,0" TextWrapping="Wrap" Text="1" VerticalAlignment="Top" Width="120"/> | |
<TextBox x:Name="AddRightTextBox" HorizontalAlignment="Left" Height="23" Margin="156,18,0,0" TextWrapping="Wrap" Text="2" VerticalAlignment="Top" Width="120"/> | |
<TextBlock HorizontalAlignment="Left" Margin="139,19,0,0" TextWrapping="Wrap" Text="+" VerticalAlignment="Top" RenderTransformOrigin="-9.667,-5.618"/> | |
<TextBlock HorizontalAlignment="Left" Margin="139,67,0,0" TextWrapping="Wrap" Text="=" VerticalAlignment="Top"/> | |
<TextBox x:Name="AnswerTextBox" HorizontalAlignment="Left" Height="23" Margin="156,60,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="120"/> | |
<Button x:Name="CalcButton" Content="計算" HorizontalAlignment="Left" Margin="108,100,0,0" VerticalAlignment="Top" Width="75" RenderTransformOrigin="0.502,1.6"/> | |
</Grid> | |
</Window> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Grid> | |
<Grid.RowDefinitions> | |
<RowDefinition Height="50" /> | |
<RowDefinition Height="100" /> | |
</Grid.RowDefinitions> | |
<Grid.ColumnDefinitions> | |
<ColumnDefinition Width="1*" /> | |
<ColumnDefinition Width="2*" /> | |
<ColumnDefinition Width="3*" /> | |
</Grid.ColumnDefinitions> | |
</Grid> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Grid Margin="10,10,10,10"> | |
<Grid.RowDefinitions> | |
<RowDefinition /> | |
<RowDefinition /> | |
<RowDefinition /> | |
</Grid.RowDefinitions> | |
<Grid.ColumnDefinitions> | |
<ColumnDefinition Width="4*" /> | |
<ColumnDefinition Width="1*" /> | |
<ColumnDefinition Width="4*" /> | |
</Grid.ColumnDefinitions> | |
<TextBox Grid.Row="0" Grid.Column="0" x:Name="AddLeftTextBox" Text="1" Height="20" Margin="10,10,10,10"/> | |
<TextBlock Grid.Row="0" Grid.Column="1" Text="+" VerticalAlignment="Center" HorizontalAlignment="Center"/> | |
<TextBox Grid.Row="0" Grid.Column="2" x:Name="AddRightTextBox" Text="2" Height="20" Margin="10,10,10,10"/> | |
<TextBlock Grid.Row="1" Grid.Column="1" Text="=" VerticalAlignment="Center" HorizontalAlignment="Center"/> | |
<TextBox Grid.Row="1" Grid.Column="2" x:Name="AnswerTextBox" Height="20" Margin="10,10,10,10"/> | |
<Button Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3" x:Name="CalcButton" Content="計算" Width="80" Height="20"/> | |
</Grid> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Window x:Class="WpfApplication1.MainWindow" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
xmlns:local="clr-namespace:WpfApplication1" | |
mc:Ignorable="d" | |
Title="MainWindow" Height="170" Width="300"> | |
<Grid> | |
<TextBox x:Name="AddLeftTextBox" HorizontalAlignment="Left" Height="23" Margin="14,18,0,0" TextWrapping="Wrap" Text="1" VerticalAlignment="Top" Width="120"/> | |
<TextBox x:Name="AddRightTextBox" HorizontalAlignment="Left" Height="23" Margin="156,18,0,0" TextWrapping="Wrap" Text="2" VerticalAlignment="Top" Width="120"/> | |
<TextBlock HorizontalAlignment="Left" Margin="139,19,0,0" TextWrapping="Wrap" Text="+" VerticalAlignment="Top" RenderTransformOrigin="-9.667,-5.618"/> | |
<TextBlock HorizontalAlignment="Left" Margin="139,67,0,0" TextWrapping="Wrap" Text="=" VerticalAlignment="Top"/> | |
<TextBox x:Name="AnswerTextBox" HorizontalAlignment="Left" Height="23" Margin="156,60,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="120"/> | |
<Button x:Name="CalcButton" Content="計算" HorizontalAlignment="Left" Margin="108,100,0,0" VerticalAlignment="Top" Width="75" RenderTransformOrigin="0.502,1.6"/> | |
</Grid> | |
</Window> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Window x:Class="WpfApplication1.MainWindow" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
xmlns:local="clr-namespace:WpfApplication1" | |
mc:Ignorable="d" | |
Title="MainWindow" Height="170" Width="300"> | |
<Grid Margin="10,10,10,10"> | |
<Grid.RowDefinitions> | |
<RowDefinition /> | |
<RowDefinition /> | |
<RowDefinition /> | |
</Grid.RowDefinitions> | |
<Grid.ColumnDefinitions> | |
<ColumnDefinition Width="4*" /> | |
<ColumnDefinition Width="1*" /> | |
<ColumnDefinition Width="4*" /> | |
</Grid.ColumnDefinitions> | |
<TextBox Grid.Row="0" Grid.Column="0" x:Name="AddLeftTextBox" Text="1" Height="20" Margin="10,10,10,10"/> | |
<TextBlock Grid.Row="0" Grid.Column="1" Text="+" VerticalAlignment="Center" HorizontalAlignment="Center"/> | |
<TextBox Grid.Row="0" Grid.Column="2" x:Name="AddRightTextBox" Text="2" Height="20" Margin="10,10,10,10"/> | |
<TextBlock Grid.Row="1" Grid.Column="1" Text="=" VerticalAlignment="Center" HorizontalAlignment="Center"/> | |
<TextBox Grid.Row="1" Grid.Column="2" x:Name="AnswerTextBox" Height="20" Margin="10,10,10,10"/> | |
<Button Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3" x:Name="CalcButton" Content="計算" Width="80" Height="20"/> | |
</Grid> | |
</Window> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Grid> | |
<Grid.RowDefinitions> | |
<RowDefinition Height="50" /> | |
<RowDefinition Height="*" /> | |
</Grid.RowDefinitions> | |
<Grid.ColumnDefinitions> | |
<ColumnDefinition Width="1*" /> | |
<ColumnDefinition Width="2*" /> | |
<ColumnDefinition Width="3*" /> | |
</Grid.ColumnDefinitions> | |
<TextBlock Text="LongTextBlock" Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2" FontSize="30" | |
Margin="5,5,5,5" HorizontalAlignment="Center" VerticalAlignment="Center"/> | |
<Button Content="Click!" Grid.Row="1" Grid.Column="1" Margin="10, 10, 10, 10"/> | |
</Grid> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<StackPanel> | |
<Button Content="Button1"/> | |
<Button Content="Button2"/> | |
<Button Content="Button3"/> | |
<Button Content="Button4"/> | |
<Button Content="Button5"/> | |
</StackPanel> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<StackPanel Orientation="Horizontal"> | |
<Button Content="Button1"/> | |
<Button Content="Button2"/> | |
<Button Content="Button3"/> | |
<Button Content="Button4"/> | |
<Button Content="Button5"/> | |
</StackPanel> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Grid> | |
<Grid.ColumnDefinitions> | |
<ColumnDefinition/> | |
<ColumnDefinition/> | |
</Grid.ColumnDefinitions> | |
<StackPanel Grid.Column="0"> | |
<Button Content="Button1" Width="60"/> | |
<Button Content="Button2" Width="60"/> | |
<Button Content="Button3" Width="60"/> | |
<Button Content="Button4" Width="60"/> | |
<Button Content="Button5" Width="60"/> | |
<Button Content="Button6" Width="60"/> | |
<Button Content="Button7" Width="60"/> | |
<Button Content="Button8" Width="60"/> | |
<Button Content="Button9" Width="60"/> | |
<Button Content="Button10" Width="60"/> | |
</StackPanel> | |
<WrapPanel Grid.Column="1"> | |
<Button Content="Button1" Width="60"/> | |
<Button Content="Button2" Width="60"/> | |
<Button Content="Button3" Width="60"/> | |
<Button Content="Button4" Width="60"/> | |
<Button Content="Button5" Width="60"/> | |
<Button Content="Button6" Width="60"/> | |
<Button Content="Button7" Width="60"/> | |
<Button Content="Button8" Width="60"/> | |
<Button Content="Button9" Width="60"/> | |
<Button Content="Button10" Width="60"/> | |
</WrapPanel> | |
</Grid> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Grid> | |
<Grid.ColumnDefinitions> | |
<ColumnDefinition/> | |
<ColumnDefinition/> | |
</Grid.ColumnDefinitions> | |
<ScrollViewer Grid.Column="0"> | |
<StackPanel> | |
<Button Content="Button1" Width="60"/> | |
<Button Content="Button2" Width="60"/> | |
<Button Content="Button3" Width="60"/> | |
<Button Content="Button4" Width="60"/> | |
<Button Content="Button5" Width="60"/> | |
<Button Content="Button6" Width="60"/> | |
<Button Content="Button7" Width="60"/> | |
<Button Content="Button8" Width="60"/> | |
<Button Content="Button9" Width="60"/> | |
<Button Content="Button10" Width="60"/> | |
</StackPanel> | |
</ScrollViewer> | |
<WrapPanel Grid.Column="1"> | |
<Button Content="Button1" Width="60"/> | |
<Button Content="Button2" Width="60"/> | |
<Button Content="Button3" Width="60"/> | |
<Button Content="Button4" Width="60"/> | |
<Button Content="Button5" Width="60"/> | |
<Button Content="Button6" Width="60"/> | |
<Button Content="Button7" Width="60"/> | |
<Button Content="Button8" Width="60"/> | |
<Button Content="Button9" Width="60"/> | |
<Button Content="Button10" Width="60"/> | |
</WrapPanel> | |
</Grid> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Canvas> | |
<Button Canvas.Left="10" Canvas.Top="10" Content="A" Width="40" Height="40"/> | |
<Button Canvas.Left="116" Canvas.Top="19" Content="B" Width="25" Height="101"/> | |
<Button Canvas.Left="10" Canvas.Top="61" Content="C" Width="78" Height="40"/> | |
<Button Canvas.Left="157" Canvas.Top="49" Content="D" Width="111" Height="40"/> | |
</Canvas> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Grid Margin="10,10,10,10"> | |
<Grid.RowDefinitions> | |
<RowDefinition /> | |
<RowDefinition /> | |
<RowDefinition /> | |
</Grid.RowDefinitions> | |
<Grid.ColumnDefinitions> | |
<ColumnDefinition Width="4*" /> | |
<ColumnDefinition Width="1*" /> | |
<ColumnDefinition Width="4*" /> | |
</Grid.ColumnDefinitions> | |
</Grid> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Grid Margin="10,10,10,10"> | |
<Grid.RowDefinitions> | |
<RowDefinition /> | |
<RowDefinition /> | |
<RowDefinition /> | |
</Grid.RowDefinitions> | |
<Grid.ColumnDefinitions> | |
<ColumnDefinition Width="4*" /> | |
<ColumnDefinition Width="1*" /> | |
<ColumnDefinition Width="4*" /> | |
</Grid.ColumnDefinitions> | |
<TextBox Grid.Row="0" Grid.Column="0" x:Name="AddLeftTextBox" Text="1" /> | |
<TextBlock Grid.Row="0" Grid.Column="1" Text="+" /> | |
<TextBox Grid.Row="0" Grid.Column="2" x:Name="AddRightTextBox" Text="2" /> | |
<TextBlock Grid.Row="1" Grid.Column="1" Text="=" /> | |
<TextBox Grid.Row="1" Grid.Column="2" x:Name="AnswerTextBox" /> | |
<Button Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3" x:Name="CalcButton" Content="計算" /> | |
</Grid> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment