こんにちは。
Windows10でWPFのアプリケーションを開発しています。
Visual Studio 2015 Communityを使っています。
###前提・実現したいこと
Excelで作るような罫線つきの表をxamlでつくりたいです。
###試したこと
項目は次のxamlのようにしています。
###発生している問題・エラーメッセージ
罫線を引けていないです。そもそも罫線はLineを使うのでしょうか? 使うとしたら、Grid.Rowは別に用意する必要あり?
###該当のソースコード
xaml
1<UserControl x:Class="TableUserControl.Tableusercontrol" 2 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 3 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 4 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 5 xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 6 xmlns:local="clr-namespace:TableUserControl" 7 mc:Ignorable="d" 8 d:DesignHeight="100" d:DesignWidth="400"> 9 <Grid> 10 <Grid.ColumnDefinitions> 11 <ColumnDefinition Width="67*"/> 12 <ColumnDefinition Width="22*"/> 13 <ColumnDefinition Width="72*"/> 14 </Grid.ColumnDefinitions> 15 16 <!--1列目--> 17 <Grid Grid.Column="0"> 18 <Grid.RowDefinitions> 19 <RowDefinition Height="29*" x:Name="HeaderRowA"/> 20 <RowDefinition Height="29*"/> 21 <RowDefinition Height="49*"/> 22 </Grid.RowDefinitions> 23 <TextBox x:Name="HeaderTextA" Grid.Row="0" TextWrapping="WrapWithOverflow" HorizontalAlignment="Center" VerticalAlignment="Center" BorderBrush="Transparent">名称/写真</TextBox> 24 <TextBox x:Name="AreaTextA" Grid.Row="1" TextWrapping="WrapWithOverflow" HorizontalAlignment="Center" VerticalAlignment="Center" x:FieldModifier="public">textA</TextBox> 25 <Image x:Name="AreaImageB" Grid.Row="2" Drop="image_Drop" /> 26 </Grid> 27 28 <!--2列目--> 29 <Grid Grid.Column="1"> 30 <Grid.RowDefinitions> 31 <RowDefinition Height="29*" x:Name="HeaderRowB"/> 32 <RowDefinition Height="99*"/> 33 </Grid.RowDefinitions> 34 <TextBox x:Name="HeaderTextB" Grid.Row="0" TextWrapping="WrapWithOverflow" HorizontalAlignment="Center" VerticalAlignment="Center" 35BorderBrush="Transparent">サンプル</TextBox> 36 <TextBox Grid.Column="1" x:Name="AreaTextC" Grid.Row="1" Grid.RowSpan="3" 37 FontSize="14" TextWrapping="WrapWithOverflow" HorizontalAlignment="Center" VerticalAlignment="Center" >textC</TextBox> 38 </Grid> 39 40 <!--3列目--> 41 <Grid Grid.Column="2"> 42 <Grid.RowDefinitions> 43 <RowDefinition Height="29*" x:Name="HeaderRowC"/> 44 <RowDefinition Height="33*"/> 45 <RowDefinition Height="33*"/> 46 <RowDefinition Height="33*"/> 47 </Grid.RowDefinitions> 48 <Rectangle Fill="#FFF4F4F5" HorizontalAlignment="Left" Grid.Row="0" Stroke="Black" VerticalAlignment="Top" Width="96" /> 49 <TextBox x:Name="HeaderTextC" Grid.Row="0" TextWrapping="WrapWithOverflow" HorizontalAlignment="Center" VerticalAlignment="Center" 50BorderBrush="Transparent">特徴</TextBox> 51 <TextBox x:Name="AreaTextD" Grid.Row="1" TextWrapping="WrapWithOverflow" x:FieldModifier="public">textD</TextBox> 52 <TextBox x:Name="AreaTextE" Grid.Row="2" TextWrapping="WrapWithOverflow" >textE</TextBox> 53 <TextBox x:Name="AreaTextF" Grid.Row="3" TextWrapping="WrapWithOverflow" >textF</TextBox> 54 </Grid> 55 </Grid> 56</UserControl>
###補足情報(言語/FW/ツール等のバージョンなど)
Microsoft Visual Studio Community 2015
Version 14.0.25424.00 Update 3
Microsoft .NET Framework
Version 4.6.01038
インストールしているバージョン:Community
Visual C# 2015 00322-20000-00000-AA575
Microsoft Visual C# 2015
です。
よろしくお願いします。

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/02/06 03:04
2017/02/06 03:20