in
Forums
Blogs
Files
Devexpress.Com
Client Center
Support Center
DevExpress Channel

Gary's Blog

XAF Cookbook #5 – Customise Your Default BO Images

Problem

You wish to substitute the default image, for a business object, with a custom one of your own.

Solution

Create two images one 16X16, the other 32X32, name the smaller one with the name of your business object and the larger one with the name of your business object with “_Large” appended to it. In the module where you created your business object, create a folder named “Images”. Add both of your images to this folder and include them in the project. Set both the image’s “Build Action” properties to “Embedded Resource”. Next, open the model editor and navigate to Application –> BOModel –> <your BO name> and set the “ImageName” property to the name of your BO. Save the model. Run your application again and the default images in both the navbar and the icon for the the details view window will have been replaced.

Discussion

Although you can use any type of graphics file, the png format is best because of its support for the alpha channel. Also, if you use image sizes other than 16X16 and 32X32 the image will be resized for the details view window icon, but not for the navbar image. Further details can be found here.

Technorati tags:
Digg This
Published Sep 08 2008, 04:41 PM by Gary Short (Developer Express)
Filed under:
Technorati tags: XAF Cookbook

Comments

 

Michael Proctor said:

Just a word of warning, firstly something not mentioed here is that for VB you must add "Images." in front of your image.

ALSO a BIG NOTE is that both "Images." and "_Large" are case-sensitive.

Cheers,

Michael Proctor

September 8, 2008 8:00 PM

Leave a Comment

(required)  
(optional)
(required)  
Verification code: Required
   
Add
Copyright © 1998-2008 Developer Express Inc.
ALL RIGHTS RESERVED