How can I make the image size smaller on a button?

后端 未结 6 1504
名媛妹妹
名媛妹妹 2021-02-05 00:00

I have a button and I want image (.ico file) and text to exist on it. My problem is that I want button\'s height to be small, but I can\'t manage to \"shrink\" the image as much

相关标签:
6条回答
  • 2021-02-05 00:21

    If you have the Image with size 16*16 then set these Button properties at design time. 1) TextImageRelation - ImageBeforeText 2) TextAlign - MiddleRight 3) ImageAlign - MiddleLeft 4) Set the

    0 讨论(0)
  • 2021-02-05 00:25

    I think if you use the Paint event of the Button you can draw any image in any size that you want. if it isn't possible to re-size the image you can do that in this way.

    0 讨论(0)
  • 2021-02-05 00:28

    If you are using DevExpress Simple Button, you should set BackgroundImageLayout = ImageLayout.Zoom and set backcolor of button to Transparent (from Appereance->Backcolor)

    0 讨论(0)
  • 2021-02-05 00:28
    ImageList imageList = new ImageList();
    imageList.ImageSize = new Size(30, 30); // specify size you want
    
    0 讨论(0)
  • 2021-02-05 00:39

    Try buttonname.BackgroundImageLayout = ImageLayout.Stretch; or change this property in designer.

    0 讨论(0)
  • 2021-02-05 00:42

    My solution was to use an ImageList control. You can define the size the images are to be displayed (e.g. I set the ImgageList ImageSize property to 16x16) and then set the button.ImageList and ImageIndex properties instead of the Image property.

    0 讨论(0)
提交回复
热议问题