开发者

Wpf app with bgImage

开发者 https://www.devze.com 2023-01-09 01:53 出处:网络
I\'m very new to this WPF technology, I started with a sticky note application which shouldlooks similar to IPhone\'s Note taking applicaiton or like the sticky note addin for visual studio Please see

I'm very new to this WPF technology, I started with a sticky note application which should looks similar to IPhone's Note taking applicaiton or like the sticky note addin for visual studio Please see this-Visual studio Addin

Can anyone please guide me how to achieve this task , or atleast the textbox background with lines inserted.Visual studio Addin

<Grid>
    <Grid.ColumnDefinitions>
        <ColumnDefinition/>
        <ColumnDefinition/>
        <ColumnDefinition/>
        <ColumnDefinition/>
    </Grid.ColumnDefinitions>

    <Grid.RowDefinitions>
        <RowDefinition/>
        <RowDefinition Height="Auto"/>
        <RowDefinition/>
        <RowDefinition/>
        <RowDefinition/>
    </Grid.RowDefinitions>

    <Border Background="#FF855E36" BorderBrush="#FF855E36"  Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="2" 开发者_Go百科BorderThickness="10" Margin="0,0,0,0">
        <TextBlock 
            HorizontalAlignment="Center" 
            FontFamily="Comic Sans MS"
            FontStyle="Normal" 
            Foreground="White"
            >Sticky</TextBlock>
    </Border>
    <ScrollViewer Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="2"  Grid.RowSpan="2" VerticalScrollBarVisibility="Auto">
        <TextBox x:Name="txtWritePad" Background="Yellow" FontFamily="Comic Sans MS" AcceptsReturn="True"/>
    </ScrollViewer>
</Grid>


It is just a background image that is set to the tile mode:

<TextBox>

  <TextBox.Background>

    <ImageBrush ImageSource="bg.png" Viewport="0,0,7,18" ViewportUnits="Absolute" TileMode="Tile"/>

  </TextBox.Background>

</TextBox>

Credit goes to :Jarrey

0

精彩评论

暂无评论...
验证码 换一张
取 消