Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Positioning Image and Text in a button

I have a Button on my Form. I want to have an image on the left and text on the right like :

Image Text

But the problem is that image is not stretched here. I mean it does not fit the button.

So I tried to set the BackGroundImage Property instead of Image Property.

Now I get the Image stretched. But I cant get the proper Format. I mean now I cant get Image on the left and Text on the right.

Is there any other control which I can use instead of button to Overcome this problem?

like image 710
Vishal Avatar asked Dec 26 '22 03:12

Vishal


2 Answers

The button has a TextImageRelation property, set it to ImageBeforeText. Set the Image property with your image and there you go.

like image 136
OneFineDay Avatar answered Jan 10 '23 02:01

OneFineDay


I don't think using stretch will in any case. How is it supposed to determine the border to stretch to? With the imagealign set middleleft and the textalign set middleright I was able to make this button, it's 82X48. The image I used is 52X39. I used paint to resize the image.

enter image description here

like image 37
tinstaafl Avatar answered Jan 10 '23 02:01

tinstaafl