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 8902087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:31:31+00:00 2026-06-15T01:31:31+00:00

I have a custom made User control with a button within it. I have

  • 0

I have a custom made User control with a button within it. I have various XAMLs using this control, but in one of the XAMLs I would like to have the button have an image on it. This works well, but I cannot seem to get the border of the button to disappear. I am able to set the background color, border thickness, and various other properties but no matter what I do I can’t get rid of the border. I’ve looked at various SO topics on how to use styles to override the template but that doesn’t seem to help me either. Below is the last piece of snippet that I tried to no avail.

<Style TargetType="{x:Type CustomButton}" x:Key="btnnoborder">
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="{x:Type CustomButton}">
                <Border Background="Transparent">
                    <ContentPresenter/>
                </Border>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

EDIT

I’ve attached small images of what I see when I test out any of these snippets

Default image (Usual button)

Viktor La Croix (Button after using Viktor La Croix’s XAML)

  • 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-15T01:31:32+00:00Added an answer on June 15, 2026 at 1:31 am

    I wasn’t going to answer this, but did you run it? Are you sure it’s not only in designtime? I used your style and it works fine. No border at runtime. At designtime I see border of button itself and image within that button.

    enter image description here

    My custom style:

        <UserControl.Resources>
        <Style x:Key="ButtonStyle2" TargetType="{x:Type Button}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <Grid>
                            <Rectangle/>
                            <ContentPresenter HorizontalAlignment="Left" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="11,7,0,9"/>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsFocused" Value="True"/>
                            <Trigger Property="IsDefaulted" Value="True"/>
                            <Trigger Property="IsMouseOver" Value="True"/>
                            <Trigger Property="IsPressed" Value="True"/>
                            <Trigger Property="IsEnabled" Value="False"/>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>
    
        <Button Style="{StaticResource ButtonStyle2}" Height="30" HorizontalAlignment="Left" Margin="782,211,0,0" Name="button5" VerticalAlignment="Top" Width="129">
            <Image Source="image.png"/>
        </Button>
    

    And with your custom style it looks like this:

    enter image description here

    But it’s only at designtime. At runtime there is no border.

    EDIT

    If there is any border brush. It’s not within that button style.

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

Sidebar

Related Questions

I have made one custom user control (search text box), which basically consists of
I have a custom-made view that extends the View class. I would like 2
I have made a custom control in my application. It is like a combo
I have a form and two custom UserControl that I made myself. one control
I have a custom user control that I made called OrderForm.ascx . I also
I have a custom GridView like control made of a Grid panel with several
I have a custom templated control(toolbar) that contains a custom usercontrol(button) The button uses
I have a made a custom datagridview with custom column objects. One of the
I'm having an issue where I have made a user control with two content
I have made custom login control for DNN (DotNetNuke). Now I am trying to

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.