Use Rectangle, TextBlock and Button as the VisualBrush : Rectangle « Windows Presentation Foundation « VB.Net

Home
VB.Net
1.2D
2.Application
3.Class
4.Data Structure
5.Data Types
6.Database ADO.net
7.Development
8.Event
9.File Directory
10.Generics
11.GUI
12.Language Basics
13.LINQ
14.Network Remote
15.Security
16.Thread
17.Windows Presentation Foundation
18.Windows System
19.XML
20.XML LINQ
VB.Net Tutorial
VB.Net by API
VB.Net » Windows Presentation Foundation » RectangleScreenshots 
Use Rectangle, TextBlock and Button as the VisualBrush
Use Rectangle, TextBlock and Button as the VisualBrush
       
<Page  
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
  x:Class="Microsoft.Samples.Graphics.UsingVisualBrush.PaintingWithVisuals">
    <StackPanel>
        <Rectangle Width="150" Height="150" Stroke="Black" Margin="0,0,5,0">
            <Rectangle.Fill>
                <VisualBrush Viewport="0,0,50,50" ViewportUnits="Absolute" TileMode="Tile">
                    <VisualBrush.Visual>
                        <StackPanel Background="Transparent">
                            <Rectangle Width="25" Height="25" Fill="Red" Margin="2" />
                            <TextBlock FontSize="10pt" Margin="2">Hello, World!</TextBlock>
                            <Button Margin="2">A Button</Button>
                        </StackPanel>
                    </VisualBrush.Visual>
                </VisualBrush>
            </Rectangle.Fill>
        </Rectangle>
    </StackPanel>
</Page>

   
    
    
    
    
    
    
  
Related examples in the same category
1.Set Stroke, StrokeThickness for RectangleSet Stroke, StrokeThickness for Rectangle
2.Fill Rectangles with static ImageBrush resourcesFill Rectangles with static ImageBrush resources
3.Fill Rectangle with BisqueFill Rectangle with Bisque
4.Rotating rectanglesRotating rectangles
5.Rounded rectangleRounded rectangle
6.Rectangle with explicit size and positionRectangle with explicit size and position
7.Rectangles with size and position controlled by parentRectangles with size and position controlled by parent
8.Using ImageBrush to fill a RectangleUsing ImageBrush to fill a Rectangle
9.Draws a 100 by 50 rectangle with a solid blue fillDraws a 100 by 50 rectangle with a solid blue fill
10.Draws a 100 by 50 rectangle with a solid blue fill, a black outline, and rounded cornersDraws a 100 by 50 rectangle with a solid blue fill, a black outline, and rounded corners
11.Rectangle StrokeThicknessRectangle StrokeThickness
12.Rectangle.StrokeRectangle.Stroke
13.Use Customized LinearGradientBrush to paint a RectangleUse Customized LinearGradientBrush to paint a Rectangle
14.Set RadiusX and RadiuxY for RectangleSet RadiusX and RadiuxY for Rectangle
15.Fill Rectangle with LinearGradientBrush static resourceFill Rectangle with LinearGradientBrush static resource
16.Using a DrawingBrush resource to draw RectangleUsing a DrawingBrush resource to draw Rectangle
17.A rectangle with a linear fillA rectangle with a linear fill
18.A large rectangle built using an image brushA large rectangle built using an image brush
19.Fill Rectangle with ResourceFill Rectangle with Resource
20.Add Rectangle.Triggers collection into a styleAdd Rectangle.Triggers collection into a style
21.DashArray StrokeDashArray Stroke
22.Dash patternsDash patterns
23.Put Rectangle into TextBlockPut Rectangle into TextBlock
24.Rectangle mouse down eventRectangle mouse down event
25.Rectangle mouse down previewRectangle mouse down preview
26.Change MaxHeightChange MaxHeight
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.