I am working on Windows Form in VB.NET 2005, and I would like to have a few buttons with images (I'm talking about a simple, vanilla System.Windows.Forms.Button). Everything is set up for me the way I want, but the images are displayed too low on the button, so the bottom of the icon is almost to the right at the bottom of the button, and there is a lot of space above the image.
Here is a screenshot:A snapshot of the button http://www.freeimagehosting.net/uploads/b28a5c63b8.jpg
See how the corner of the icon is cropped to the bottom of the button?
My button is 23 pixels high, and the image is a 16 x 16 icon (converted to a bitmap so that it can be assigned to the Image property).
I tried setting the Margin.All property to 0 and checking that the Padding.All property was 0. I also tried changing the ImageAlign button to TopLeft, MiddleLeft and BottomLeft, but none of these settings seem to have any effect.
Does anyone know how I can position the image at an equal distance from the top and bottom edges of the button? I can resize the button or image if necessary, but they are at my preferred size, and I would like to save them that way if possible.
We usually set the following properties (for example, for the image on the right):
ImageAlign: MiddleRight TextAlign: MiddleLeft
, . , Image, BackgroundImage, , . ?
, , . ( ?)
, ImageAlign , . , () . , "TopLeft", CENTERED .
, , ImageAlign "" . 16x16 - 16 - . - 8 9. 8.5 , VB 8, 8 . .
(23px), , - 12. VB (8) (12). 8 7 . , 1 .
: 1 . , (17 ), , .
. . , , 1px. , .
. EVEN . , , . (-, , ). , .
Just a question: are you sure that the bitmap does not contain information at the top of the note image? This happened to me more than once when the crop looked right in Photoshop and crashed in live code ... :)
If so, your code might be perfect;)
Source: https://habr.com/ru/post/1702638/More articles:Как я могу создать запрос LINQ, когда тип объекта неизвестен во время компиляции - c#MVC Bulk Edit - examples - linqIs there a way to control heap usage in C ++ / MacOS? - c ++What are the differences between XSLT and T4 code generation methods? - .netPHP query string limit - phpLoad Balancing, Spring Security, ConcurrentSessionFilter - springIs Spring too complicated for JDBC operations? - javaКакую учетную карточку мне следует предоставить на мою учетную запись TFSBuild? - tfsHow to assign a set of text values to an array of strings? - arraysNHibernate - WHERE EXIST (X) - nhibernateAll Articles