Using alternate elements as the content of a Button : Button « Windows Presentation Foundation « VB.Net






Using alternate elements as the content of a Button

Using alternate elements as the content of a Button
        

<Window x:Class="WpfApplication1.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="" Height="300" Width="300">

    <StackPanel HorizontalAlignment="Center" Margin="10">
        <Button Width="50" Height="100">
            <DockPanel>
                <Ellipse Margin="5" DockPanel.Dock="Top" Stroke="Black" Fill="Red" />
                <Ellipse Margin="5" DockPanel.Dock="Top" Stroke="Black" Fill="Yellow" />
                <Ellipse Margin="5" DockPanel.Dock="Top" Stroke="Black"  Fill="Green" />
            </DockPanel>
        </Button>
    </StackPanel>
</Window>

   
    
    
    
    
    
    
    
  








Related examples in the same category

1.Rotated ButtonsRotated Buttons
2.Pendulum ButtonPendulum Button
3.Button.Background and DrawingBrushButton.Background and DrawingBrush
4.Button with Semi-Transparent imageButton with Semi-Transparent image
5.Set Width for ButtonSet Width for Button
6.Button HorizontalAlignmentButton HorizontalAlignment
7.Button PaddingButton Padding
8.Button MarginButton Margin
9.Button Padding and HorizontalAlignmentButton Padding and HorizontalAlignment
10.Button HorizontalAlignment: StretchButton HorizontalAlignment: Stretch
11.Set BlurBitmapEffect for ButtonSet BlurBitmapEffect for Button
12.Set Padding for ButtonSet Padding for Button
13.Set Margin for ButtonSet Margin for Button
14.Set Button Content with element valueSet Button Content with element value
15.Set Button Width,Height and Content String by using AttributesSet Button Width,Height and Content String by using Attributes
16.Use Button.Content to set the content for a ButtonUse Button.Content to set the content for a Button
17.Adding image to a ButtonAdding image to a Button
18.Button with no position and sizeButton with no position and size
19.Button with Property AttributesButton with Property Attributes
20.Button with Property ElementsButton with Property Elements
21.Button with default Xml namespaceButton with default Xml namespace
22.Button with named NamespaceButton with named Namespace
23.Button Based On StyleButton Based On Style
24.Property Trigger for ButtonProperty Trigger for Button
25.Setting FontSize for ButtonSetting FontSize for Button
26.Layout Tranform
27.Button's Background = ImageBrush. The resulting button has an image as its backgroundButton's Background = ImageBrush. The resulting button has an image as its background
28.A rotated ButtonA rotated Button
29.Using Button.Content to set content for ButtonUsing Button.Content to set content for Button
30.Scale TransformScale Transform
31.Scale Transformate a ButtonScale Transformate a Button
32.Fisheye Effect for ButtonFisheye Effect for Button
33.A button that has been skewed and rotatedA button that has been skewed and rotated
34.Button PreviewMouseDown action and MouseDown actionButton PreviewMouseDown action and MouseDown action
35.Button click actionButton click action
36.Add CommandTarget for ButtonAdd CommandTarget for Button
37.Adding graphics to a ButtonAdding graphics to a Button
38.Button with image and text, use grid to layout Button contentButton with image and text, use grid to layout Button content
39.Canvas with Button onCanvas with Button on
40.Resizing ButtonsResizing Buttons
41.To add a button control and a text block to the canvasTo add a button control and a text block to the canvas
42.Resizing ButtonsResizing Buttons
43.To add a button control and a text block to the canvasTo add a button control and a text block to the canvas
44.A simple template for a round buttonA simple template for a round button
45.Load style defined in Xaml and apply to the ButtonLoad style defined in Xaml and apply to the Button
46.Nested Button contentNested Button content
47.Two repeat buttons that increase and decrease a numerical value.Two repeat buttons that increase and decrease a numerical value.
48.Generate Click Events Repeatedly While a Button Is ClickedGenerate Click Events Repeatedly While a Button Is Clicked
49.Button Click event handlerButton Click event handler
50.Button mouse down eventButton mouse down event
51.Button mouse down previewButton mouse down preview
52.Set button properties with Linq styleSet button properties with Linq style
53.Simple Custom ButtonSimple Custom Button
54.Custom Shaped ButtonCustom Shaped Button
55.Raise exception from button click eventRaise exception from button click event
56.Button VerticalAlignment=Top HorizontalAlignment=LeftButton VerticalAlignment=Top  HorizontalAlignment=Left