0

私はすでにこのトピックについてネットを広く検索しましたが、少なくとも私が達成しようとしていることに近づくことができる解決策を見つけることができませんでした.

で数独アプリケーションを作成したいのですがWPF and C#、主な問題はグリッドの作成に関するものです。

グリッド自体は である必要が9 x 9あり、 がありeditable structure textbox-like、カスタム設計されたグリッドを意味します (したがって、実際の数独のように線を引くことができます。この例のように、ブロック間の太い線とセル間の小さな線を使用します:
http: //www.mathworks.com/matlabcentral/fx_files/8558/2/sudoku.png (まだ画像を投稿できません)

そして、各フィールドをテキストボックスのように機能させて、そこに値を入力して読み取り、後でグリッドをセルの配列にすることができます。

So the question is: What controls to use? How to make them textbox-like(considering those are just drawn lines) or how to set their design? Also, maybe there's an easier solution to my problem?

4

1 に答える 1

2

シンプルに保ちたい場合は、常にグリッド内でテキストボックスを使用できます...メイングリッドに3x3ユーザーコントロールを配置し、境界線の厚さを3に設定し、各コントロール内にテキストボックスを含む3x3グリッドを配置します。 1に設定するか、破線にするか、またはあなたに合ったものに...

これは、ユーザー コントロールが xaml でどのようになるかです。

<Border BorderThickness="3" BorderBrush="Black">
<Grid>
    <Grid.ColumnDefinitions>
        <ColumnDefinition></ColumnDefinition>
        <ColumnDefinition></ColumnDefinition>
        <ColumnDefinition>    </ColumnDefinition>
    </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
        <RowDefinition></RowDefinition>
        <RowDefinition></RowDefinition>
        <RowDefinition></RowDefinition>
    </Grid.RowDefinitions>
        <TextBox Grid.Row="0" Grid.Column="0" BorderBrush="Blue" BorderThickness="1"></TextBox>
        <TextBox Grid.Row="0" Grid.Column="1" BorderBrush="Blue" BorderThickness="1"></TextBox>
        <TextBox Grid.Row="0" Grid.Column="2" BorderBrush="Blue" BorderThickness="1"></TextBox>
        <TextBox Grid.Row="1" Grid.Column="0" BorderBrush="Blue" BorderThickness="1"></TextBox>
        <TextBox Grid.Row="1" Grid.Column="1" BorderBrush="Blue" BorderThickness="1"></TextBox>
        <TextBox Grid.Row="1" Grid.Column="2" BorderBrush="Blue" BorderThickness="1"></TextBox>
        <TextBox Grid.Row="2" Grid.Column="0" BorderBrush="Blue" BorderThickness="1"></TextBox>
        <TextBox Grid.Row="2" Grid.Column="1" BorderBrush="Blue" BorderThickness="1"></TextBox>
        <TextBox Grid.Row="2" Grid.Column="2" BorderBrush="Blue" BorderThickness="1"></TextBox>
</Grid>

そして、それらの3x3を持っているだけです...

于 2013-10-25T02:44:24.413 に答える