user2800306
user2800306

Reputation:

Ghost Button Appearing In WPF Application

I've recently been updating a WPF application that I worked on last year, and during testing, I noticed that one of the views looked a bit off. After installing the release version on my computer, it looks like the Submit button on one of the views appears in what is supposed to be a blank space, but beside the real submit button. The image below shows what I'm talking about.

Screenshot of issue

The Submit button on the left and the Cancel button on the right both appear and work normally, but the Submit button in the middle just appears there. It doesn't highlight when hovered or do anything when clicked. My code for this section is below.

<Grid Grid.Row="2" Grid.Column="1">
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="2*"></ColumnDefinition>
        <ColumnDefinition Width="*"></ColumnDefinition>
        <ColumnDefinition Width="2*"></ColumnDefinition>
    </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
        <RowDefinition Height="*"></RowDefinition>
        <RowDefinition Height="*"></RowDefinition>
        <RowDefinition Height="*"></RowDefinition>
    </Grid.RowDefinitions>
    <Button Name="SubmitButton"
            Grid.Column="0"
            Grid.Row="1"
            FontSize="30"
            Foreground="#DC0034"
            FontWeight="DemiBold"
            Click="SubmitInfo">SUBMIT</Button>
    <Button Name="RestartButton"
            Grid.Column="2"
            Grid.Row="1"
            FontSize="30"
            Foreground="#DC0034"
            FontWeight="DemiBold"
            Click="ResetForm">CANCEL</Button>
</Grid>

I tried adding a blank Grid in the area that the extra Submit button is showing, but it still appears. I didn't have this issue the last time I worked on the project and I didn't edit any of the views, just backend stuff.

Any help is greatly appreciated.

Upvotes: 0

Views: 209

Answers (1)

user2800306
user2800306

Reputation:

I actually figured it out and it was really dumb on my part. The background of the view is an image and the person that designed it added a submit button to the image itself. So the "ghost" submit button that I was seeing was actually part of the background image. Thank you for the helpful comments though!

Upvotes: 1

Related Questions