Remove all unnecessary space around the image button?

Well, try your best, I can’t let my life get rid of this tiny little frame around my buttons.

Edit: I have to mention, in case I don’t clarify, these are buttons with the image on them, set to be flat with the button, the size of which corresponds to the image.

Pictures below:

enter image description here Number one, for my life I cannot get these boundaries in order to go into the past. I checked everything I could think of. They are:

  • flat
  • border 0
  • borderless
  • no padding
  • size that matches the size of the image (75 pixels)
  • in the table where all the columns are:
    • manual size by image width (75 pixels)
    • boundless

Nothing seems to really “work” to get rid of them. If I reduce the columns to 74px instead of 75px, most of them will disappear, but not much remains. I did a triple and quadruple control of the images, and they have nothing to pick, this should be the reason for this ... there is no transparency around the borders, definitely there is no border that looks like this.

This leads me to the second problem:

enter image description here

Settings button with a small dialog ...

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

The settings button is also located on the same panel of the table layout.

I also checked all the settings in the table layout panel. I can not find any additions or fields or any settings that suggest that this should happen.

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

+7
source share
5 answers

A simple solution: use the PictureBox directly, as if it were a button. You can change the image using the mouse or mouse click.

+1
source

Have you tried the toolbar / strip / everything that it called these days? I’m probably not going to help, as I think it puts off on your behalf, but worth it.

At the end, you can drop the buttons in the basket and write your own control. The single control that controls the N buttons will work well here.

I do not understand your second problem. What is the problem? This will be fixed if you roll your own control anyway.

0
source

Without fixing the spacing issue, as a workaround, you can make this gray gradient currently "behind" the tabs and the control panel image in BackgroundImage for TableLayoutPanel using BackgroundImageLayout in Stretch . Without fixing the problem at intervals, this would make it inconspicuous.

0
source

Writing a winforms control has its problems (experience here). I would agree that this is necessary. Depending on your project, you can use XAML and WPF. It provides the exact details that you seem to be looking for in your application.

There are ways to host XAML controls in a winform application, but if you went this route, it would be better to create your own WPF application. The converse is also true (winform controls in a WPF application).

0
source

Have you checked if the image has transparent pixels around the desired graphic pixels?

May be a simple crop solution.

0
source

All Articles