how to make a button with both a picture and text

Find and share HowTos to various installations / configurations!
4 posts • Page 1 of 1
tmalone
Posts:192
Joined: Mon Nov 22, 2010 11:21 pm

how to make a button with both a picture and text

Post by tmalone »

Is there a trick to making a button with BOTH a picture AND text? Seems like a common way to display a button.

I can imagine that I can take the picture and add text to the picture, but that will not scale very well, etc.

Todd Malone
Siemens HMI CoC USA

Gertjan van Schijndel
Posts:634
Joined: Mon Aug 02, 2010 10:37 am

Re: how to make a button with both a picture and text

Post by Gertjan van Schijndel »

You can use this code to add text to your image button.

Code: Select all

PUSH_BUTTON.buttonType = BT_PIXMAP_TEXT';
PUSH_BUTTON.text = "your text";
Optionally you can add this code to place the text below the image.

Code: Select all

PUSH_BUTTON.textPosition = "TEXT_BELOW_PIXMAP";

tmalone
Posts:192
Joined: Mon Nov 22, 2010 11:21 pm

Re: how to make a button with both a picture and text

Post by tmalone »

Thanks to the forum for this easy solution. Maybe we can document this in the help for other people!!! This seems like a common visualization technique that people would like to use.

Todd Malone
HMI CoC USA

leoknipp
Posts:2928
Joined: Tue Aug 24, 2010 7:28 pm

Re: how to make a button with both a picture and text

Post by leoknipp »

Hello,

in the online-help for 3.12 the example for "buttonType" describes how BT_PIXMAP_TEXT can be used. The information how the text can be set is missing.
I've already reported it to our documentation group.

Best Regards
Leopold Knipp
Senior Support Specialist

4 posts • Page 1 of 1