Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8984399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:05:48+00:00 2026-06-15T21:05:48+00:00

I had a Image and Button like this in WPF: <Image HorizontalAlignment=Left Height=31.627 VerticalAlignment=Top

  • 0

I had a Image and Button like this in WPF:

<Image HorizontalAlignment="Left" Height="31.627" VerticalAlignment="Top" Width="32" Margin="21,80.373,0,0" Source="Images\computer.png"/>
<Button FontWeight="Bold" FontSize="12" Content=swethapilli" Height="31.627" VerticalAlignment="Top" Margin="57,80.373,95.296,0"/>

Now it appears like this:

enter image description here

Now my requirement is when mouse hover on the Image or Button. the text (swethapilli) should move to right and highlight when the arrow image appears same as like the below image.

it should appear like this

How to get this style can any one please help me to find the solution. Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T21:05:50+00:00Added an answer on June 15, 2026 at 9:05 pm

    I think the easiest way is to create an image which you can use as button background when mouse is over, like so:

        <Style x:Key="SwitchButtonStyle" TargetType="Button">
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Background">
                        <Setter.Value>
                            <ImageBrush ImageSource="yourimagepath.ending"></ImageBrush>
                        </Setter.Value>
                    </Setter>
                    <Setter Property="HorizontalContentAlignment" Value="Right"/>
                </Trigger>
             </Style.Triggers>
         </Style>
    

    EDIT: A more flexible way to position your content is the following:

    Take a TextBlock as buttons content:

                <Button.Content>
                    <TextBlock Text="YourTextOrBinding" Style="{DynamicResource ResourceKey=TextBlockOnButtonStyle}"></TextBlock>
                </Button.Content>
    

    TextBlockOnButtonStyle:

        <Style x:Key="TextBlockOnButtonStyle" TargetType="TextBlock">
            <Style.Triggers>
                <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type Button}}, Path=IsMouseOver}" Value="True">
                    <Setter Property="Margin" Value="10,0,0,0"></Setter>
                </DataTrigger>
            </Style.Triggers>
        </Style>
    

    The 10 in the setters value is the number of pixels which the text goes to the right if the mouse is over the button.

    EDIT 2: If you want to use a rectangle instead of the whole image as buttons background, you can do it like so:

            <DockPanel Width="100" Height="30">
                <Rectangle Visibility="{Binding ElementName=btnMain, Path=IsMouseOver, Converter={StaticResource ResourceKey=BoolToVis}}" Width="25">
                    <Rectangle.Fill>
                        <whateveryouwanttousetofilltheimage>
                    </Rectangle.Fill>
                </Rectangle>
                <Button Name="btnMain" Content="YourContentOrBinding"/>
            </DockPanel>
    

    Here I bound the Visibility of the rectangle to the buttons IsMouseOver-property and converted the output with the BooleanToVisibilityConverter.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What if I had somthing like this <div class=fb-like-box data-href= data-width=292 data-show-faces=true data-stream=true data-header=false
I originally had a submit button like this <form action=<?php $self ?> method=post >
If i had an image with a url such as img/160x180.jpg how using this
OK i am really struggling with this! I know had to add an image
This fiddle demonstrates the problem. I'm trying to align an image and a button
I had image for Products and i want user when click on image appear
I had an image in image in my iPhone application. The text in the
EDIT: I was an idiot. I simply had an image that was vertically long,
i Had load my image Buffered image now need to brighten it using Slider
I had a problem working with the image classes in java. I am creating

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.