Sign in to follow this  
Followers 0
Grasty

Button Control, Multiple Styles

2 posts in this topic

#1 ·  Posted

So I have a button that is 80x80 which I have assigned an icon image to, and that works .... But i also want to use the style to put the button text at the bottom of the button, and i cant seem to make this work

 

$Button = GUICtrlCreateButton("Test",100,100,80,80,$BS_ICON)

GUICtrlSetImage($Button,"C:\icon.ico")

 

The above works for the Icon portion, and the background on the icon is transparent so you can still see the button effects like the hover and such, but if i try and add $BS_BOTTOM as well it doesnt work. So i did some google searching and found a post about using BitOR, so i modified it to the following

 

$Button = GUICtrlCreateButton("Test",100,100,80,80,BitOR($BS_ICON,$BS_BOTTOM))

GUICtrlSetImage($Button,"C:\icon.ico")

 

But that doesnt seem to work. Am i doing something wrong? or is there another way to do this. Its shifting the image up and the text isnt showing at all.

button.png

 

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Ok, so i figured out how to make it work ... i just had to make my icon smaller in height so it doesnt take up the entire button and then the text just naturally moves into place.

 

My new question though, is there a way to adjust the padding for the text? The hard drive image there is all the way up against the bottom edge of that icon and the text is taking up a lot of space vertically. 

 

If i cant do it, then i cant do it .... but it would be really nice if i could adjust that vertical padding.

 

button2.png

Edited by Grasty

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0