A blog about any interesting "Microsoft Dynamics AX" and "Microsoft Dynamics 365 for Finance and Operations" stuff I come across.
Sunday, September 28, 2008
Compacting your virtual harddisks
Here is a good article on how you go about compacting these endlessly growing virtual harddisks: http://jopx.blogspot.com/2008/09/compacting-virtual-harddisks-vhds.html
Thursday, September 25, 2008
ImageListAppl classes
The idea with the ImageListAppl classes is that you load and cache a list of images once in for example a form. For each record where you want to show an image, through a display method you just lookup the image in the cached list.
However I often see code where the image list is loaded in the display method itself, putting some overhead on the display method.
Steps to use an ImageListClass
First of all, create a form window control to hold the images. These would be appropriate properties if you place this control in a grid:
In the ClassDeclaration of the form declare your ImageListAppl class:
In the init method of the form, initialize your ImageListAppl object:
And still in the init method pass the list of images to your window control:
Implement your display method driving which image to show:
That's it...
However I often see code where the image list is loaded in the display method itself, putting some overhead on the display method.
Steps to use an ImageListClass
First of all, create a form window control to hold the images. These would be appropriate properties if you place this control in a grid:
Property | Value |
AutoDeclaration | Yes |
AllowEdit | No |
Width | 14 |
Height | 14 |
Enabled | No |
Skip | Yes |
AlignControl | No |
ImageMode | Size to fit |
ShowLabel | No |
DataSource | Your controlling datasource |
DataMethod | Your method to select the right image |
In the ClassDeclaration of the form declare your ImageListAppl class:
ImageListAppl_MyImageList imageListAppl;
In the init method of the form, initialize your ImageListAppl object:
imageListAppl = new ImageListAppl_MyImageList();
And still in the init method pass the list of images to your window control:
myWindowControl.imageList(imageListAppl.imageList());
Implement your display method driving which image to show:
//BP Deviation Documented
display ImageRes myDisplayMethod(MyRecord _myRecord)
{
ImageRes res = -1;
#resAppl;
if (_myRecord.someConditioin())
{
res = imageListAppl.image(#MyImage);
}
return res;
}
That's it...
Subscribe to:
Posts (Atom)