trycatch
trycatch

Reputation: 578

Remove all extra space around a button with an image?

Alright, try as I might, I cannot for the life of me get rid of this tiny little border around my buttons.

Edit: I should mention, in case I didn't make it clear, these are buttons with an image on them, set to flat with the button sized to the image.

Images below:

enter image description here Number one, I can't for the life of me get these borders to GO AWAY. I've checked everything I can think of. They're:

Nothing seems to really "work" to get rid of these. If I size the columns down to be 74px instead of 75px, most of them go away, but a few remain. I've triple and quadruple checked the images, and they don't have anything that I can pick up on that should be causing this... no transparency around the borders, definitely no border that looks like that.

Which leads me to the second problem:

enter image description here

Settings button when dialog is small...

enter image description here Settings button when dialog is stretched out.

Settings button is also in the same table layout panel.

I've checked all the settings on the table layout panel as well.. I can't find any padding or margin or anything settings that suggest this should be happening.

Does anyone have any experience with this? What am I missing..?

Upvotes: 7

Views: 1384

Answers (5)

Alejandro del Río
Alejandro del Río

Reputation: 4046

Simple solution: using directly a PictureBox as if it was a button. You can change your image on mouse over or mouse click.

Upvotes: 2

Gary93730
Gary93730

Reputation: 441

Did you check if the image has transparent pixels around the graphic pixels you want?

May be a simple crop solution.

Upvotes: 0

tHand
tHand

Reputation: 301

Writing a winforms control has its challenges (experience speaking here). I would agree that that is whats needed however. Depending on your project you may consider using XAML and WPF. It provides that fine detail you seem to be looking for in you application.

There are ways to host XAML controls in a winform app, but if you went this route it would be best to create a native WPF application. The reverse is also true (winform controls in a WPF app).

Upvotes: 0

Mike Guthrie
Mike Guthrie

Reputation: 4059

While not a fix for the spacing issue, as a workaround you can make that gray gradient currently "behind" the "tabs" and control panel image into a BackgroundImage for the TableLayoutPanel using BackgroundImageLayout of Stretch. While not fixing the spacing issue, it would make it unnoticeable.

Upvotes: 0

Tergiver
Tergiver

Reputation: 14507

Have you tried a Toolbar/strip/whatever it's called these days? Probably not going to help as I believe it pads on your behalf, but worth a shot.

In the end you can toss the buttons in the trash and write your own control. A single control that manages N buttons will work well here.

I don't understand your second problem. What's the problem? It'll be fixed if you roll your own control anyhow.

Upvotes: 0

Related Questions