Results 1 to 2 of 2

Thread: Border Style change

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2003
    Location
    Auckland
    Posts
    1,139

    Border Style change

    I have a DockPanel where in VB.NET I'm adding borders to it at runtime. I'm adding a style resource to this border too.

    Via VB.NET code I want to on the mouse over event change the style and then change it back on a mouse out event. How can I do this via VB.NET code?

  2. #2

    Re: Border Style change

    Hii Kiwis,
    You can change color of border using IsMouseOver property.
    Try this code to change color of border at mouse over time.

    Code:
    <TextBox Text="ChangeBorder" x:Name="border">
                <TextBox.Style>
                    <Style TargetType="{x:Type TextBox}">
                        <Setter Property="BorderBrush" Value="Red"></Setter>
                        <Style.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="BorderBrush" Value="Bisque"></Setter>
                            </Trigger>
                        </Style.Triggers>
                    </Style>
                </TextBox.Style>
            </TextBox>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width