Thursday, March 29, 2012

Various Images in a Grid - Part II

I have previously posted a way to show different images in a grid on Weblogs using 5 image objects and employing DynamicCurrentControl property of the grid.  That is because the need is limited only to that 5 images.

However, now that I need to really show varying undetermined number of images on a grid based on outside image files (jpegs) in a folder, that approach is a no no.  Therefore I sought other ways shown by experts such as Cetin Basoz and checked how that can be implemented on my needs. 

Most of the codes are adapted from Cetin's especially the usage of DynamicFontBold, except that this approach gets the images straight on outside files in a folder.  The trick is to be able to link the record with the real file name of the image file via one field (or several combined fields).  And since mine has an asset number and the images are named after the asset number (by design), then it did not pose any problem.  Here is the result:

Wednesday, March 28, 2012

More Objects Inside a Grid Cell

In pursuit of making the appearances of our app more powerful, I decided to make my grid more appealing by way of showing several objects inside a cell.  And that can be attained via containers plus manipulating .controlsource(s).

Let us say I have this SQL SELECT:

SELECT fld1, fld2, fld3, fld4, fld5, fld6, fld7, fld8, fld9, fld10 from mytable into cursor junk nofilter

So I have 10 fields above.  Normally we would have 10 columns as well to show everything inside a grid, a column for each field, a record for each row.  Now, I wanted to show only 2 columns where fields 1 to 5 will all be cramped inside Column1 and the rest on Column2.  Here is how to do it.

By default, a grid will bind itself to the current active table/cursor and will follow the field arrangement like in the above fld1, fld2.....etc.  Ignore the sequence of the fields because it will be useless now. 

Tuesday, March 20, 2012

Controlling the Panel from Within - Part II

Last time I created a blog called 'Controlling the Panel from Within' which I posted in Weblogs.

While I showed there how we can do that, it is limited to controlling just the main applet.  It do not show how we can dig down from within that applet.  This is actually supposed to be titled 'Drilling Down an Applet' but readers may say, what the heck is that?  So I instead named this as above.

On my first blog, I showed the way to gather all applets into a form and allows user to call those applets from that listbox using ShellExecute().  Here we will use RUNDLL32 instead.  While the same can only open the main applet again, we can employ scripting here to drill down further to objects inside that applet.