Trick: Make a Picture Button in InfoPath 2010 a non-clickable image

Learn a trick to have the image of a Picture Button appear as a normal non-clickable image on an InfoPath 2010 form.

ADVERTISEMENTS

InfoPath 2010 introduced a new control called the Picture Button control. A Picture Button allows you to use images as buttons in InfoPath 2010.

The neat thing about Picture Button controls is that you can add images as Resource Files to an InfoPath form template and then reuse these images over and over again as images for as many Picture Button controls as you like.

Normal Picture controls in InfoPath 2010 allow you to either link to an image or include an image in the InfoPath form itself, but do not allow reuse through resource files. Resource files in InfoPath offer several benefits.

The nice thing is that you can leverage resource files by using Picture Buttons as normal images in InfoPath. But the downside of using Picture Buttons as normal images is that buttons are clickable and images are not.

There is a way, though, to make a Picture Button non-clickable, so that you can use them as normal pictures in InfoPath 2010 and also get the benefit of using images as resource files in InfoPath 2010.

Here's a neat little trick to make a Picture Button in InfoPath 2010 non-clickable:

  1. In InfoPath Designer 2010, create a new Blank Form template.
  2. Click the Data tab.
  3. On the Data tab under the Form Data group, click Resource Files.
  4. On the Resource Files dialog box, click Add.
  5. Browse to the image you want to add as a picture on your InfoPath form and add it as a resource file.
  6. On the Resource Files dialog box, click OK.
  7. Click the Home tab.
  8. On the Home tab under the Controls group, click Picture Button to add a picture button control to the InfoPath form template.
  9. Right-click the Picture Button control and select Picture Button Properties from the context menu.
  10. On the Picture Button Properties dialog box, select the image you just added as a resource file from the Picture drop-down list box, select the same image from the Hover picture drop-down list box, and click OK.
  11. On the Home tab under the Rules group, click Manage Rules.
  12. On the Rules task pane, click New, and then Formatting from the drop-down menu that appears.
  13. On the Rules task pane under Condition, click the text None.
  14. On the Condition dialog box, select and type the information as displayed in the following figure and then click OK.

    Condition dialog box in InfoPath 2010 with a The expression condition

    Figure 1. Condition dialog box in InfoPath 2010 with a 'The expression' condition.

  15. On the Rules task pane under Formatting, select the Disable this control check box.
  16. Press F5 to preview the InfoPath form.

Now the Picture Button should appear as a normal non-clickable image on the InfoPath form.

 
 Subscribe for updates via RSS or Email

Copyright: This article may not be used on web sites (whether personal or otherwise), copied, disseminated, altered, printed, published, broadcasted, or reproduced in any way without an expressed written consent of S.Y.M. Wong-A-Ton. The techniques demonstrated in this article may be used within any Microsoft InfoPath project. This article is provided without any warranties. Copyright for this article is non-transferrable and remains with the author, S.Y.M. Wong-A-Ton.

InfoPath 2013 Cookbook: 121 Codeless Recipes for Beginners
InfoPath 2013 Cookbook 2: 121 Codeless Recipes for SharePoint 2013
InfoPath 2010 Cookbook: 101 Codeless Recipes for Beginners
InfoPath 2010 Cookbook 2: 101 Codeless Recipes for SharePoint 2010
InfoPath 2010 Cookbook 3: 101 Code Recipes for C# Developers
InfoPath 2010 Cookbook 5: Integrating InfoPath with Excel and Excel Services


Related InfoPath Articles:

ADVERTISEMENTS

InfoPath 2013 Cookbook: 121 Codeless Recipes for Beginners

InfoPath 2013 Cookbook 2: 121 Codeless Recipes for SharePoint 2013

InfoPath 2010 Cookbook: 101 Codeless Recipes for Beginners

InfoPath 2010 Cookbook 2: 101 Codeless Recipes for SharePoint 2010

InfoPath 2010 Cookbook 3: 101 Code Recipes for C# Developers

InfoPath 2010 Cookbook 4: 101 Code Recipes for VB Developers

InfoPath 2010 Cookbook 5: Integrating InfoPath with Excel and Excel Services