Monday, May 27, 2013

ssDropCalc class in a Grid, How To?



When I shared ssClasses library, I gave a sample form on most of the classes and among it is ssDropCalc (Dropdown Calculator class) showing how to run it on a default value or formula mode plus how to use it inside a grid if you wanted to.  The sample runs good, but I believe this is the second time I was asked about how to use it in a grid where my usual response is "Please check the sample form I shared for that".

But since I just got asked again about that, I decided to test myself why despite my sample, they are still

Tuesday, May 21, 2013

ComboBox in a Grid - Combobox Trick # 2


I have promised last time I will show another combobox trick but totally forgot about it.  Then yesterday another member asked about a combobox inside a grid saying while it is working on his end, whatever is selected on the active combobox does not appear.  It appears only when the combobox on the current record looses focus.

While working directly with grids do not appeal to me, I played with his requirement and indeed it does not show the combobox' DisplayValue.  So I got curious because if I recall properly, I fixed that problem on my end before but in the end working directly on a Grid does not really appeal to me that I discarded the entire concept and went back to Add To Table approach.

Anyway, here is a working sample of that if you need one, and on the bottom note the reason why:

Saturday, May 18, 2013

Removing Ghost Devices from your unit


This is actually asked inside the forum and I said, hey this is likewise a good topic to add here in my blog, so...

What are Ghost Devices?

Well we can simply say this.  A ghost is believed to be an entity that is there but cannot be seen.  So a Ghost Device is on your unit but is hidden.  Also a ghost is a remnant of your physical being.  Ghost Devices likewise are remnants of your previous device installations like a scanner or printer that is no longer plugged into your machine, a mass storage device, a mobile phone, etc.  And even a single device can have several Ghost Entries on a single unit based on which port you plug that device to.

A ghost device is also sometimes referred to as a Phantom device.

How to manually clean Ghost Devices?

I will simply refer you instead to this Microsoft article:  http://support.microsoft.com/kb/315539

Is there a way to prevent Ghosting?

Thursday, May 16, 2013

Grid Dynamic Property via a Method way

Usage of Dynamic Properties of a Grid seems to still baffles others because the sample that we can gleam in case of DynamicBackColor when using the Grid Builder using Ledger Style is via the IIF() condition.

Something like this:

This.Grid1.Column1.DynamicBackColor = ;
      'IIF(MOD(RECNO(),2)=1,RGB(255,255,255),RGB(192,220,192))'

And so by looking at that sample, we can create some more conditions like this:

This.Grid1.Column1.DynamicBackColor = ;
      'IIF(fld1= 1,RGB(255,255,255),RGB(192,220,192))'


So the natural instinct of some developers is that when the need is based on more than two conditions, they would expand above conditions with additional IIF()

This.Grid1.Column1.DynamicBackColor = ;
      'Iif(fld1= 1,Rgb(255,255,255),Iif(fld2 = 2,Rgb(255,255,0),;
           Rgb(192,220,192)))'

Or in case of higher VFP versions that support this, an ICASE() condition:

Wednesday, May 15, 2013

Choosing the Fastest Internet Connection Setting near you!


Normally your Internet Service Provider (ISP) controls the settings you can use to connect to internet.   They also have their own Domain Name System (DNS).  But accidentally I found out that while that is the normal way, we can still improve its speed.  And the trick lies in not relying blindly onto the DNS used and provided by our ISP.

What is DNS anyway?

An often-used analogy to explain the Domain Name System is that it serves as the phone book for the Internet by translating human-friendly computer hostnames into IP addresses. For example, the domain name www.example.com translates to the addresses 192.0.43.10 (IPv4) and 2001:500:88:200::10 (IPv6). Unlike a phone book, the DNS can be quickly updated, allowing a service's location on the network to change without affecting the end users, who continue to use the same host name. Users take advantage of this when they use meaningful Uniform Resource Locators (URLs) and e-mail addresses without having to know how the computer actually locates the services   - Wikipedia

It simply says that because we as humans remember names better than number combinations, then DNS is responsible in translating for instance sandstorm36.blogspot.com into its corresponding IP Address.   Imagine if we don't have DNS, then instead of saying "google it", you would end up saying "74.125.237.116 it!".  LOL!

So how does choosing the best DNS affects our browsing speed?  Well the better and more complete the phone book is, the better result we can get.

Monday, May 6, 2013

ActiveX DTPicker (MSComCtl2.DTPicker.2) on a grid, how to...


I created a post in Weblogs in 2009 on how to use the ActiveX DateTime Picker (MSComCtl2.DTPicker.2) on a grid where in addition to the instructions, I shared a sample form to show how it can be done.  But that sample form was now lost in Weblogs and while the instructions there are clear, I failed to include some more steps on the further adjustments I did the day after said blog was posted.  And so when a foxite forum member sought assistance in "taming" that elusive ActiveX DTPicker inside the grid and I pointed to my Weblogs article on that, there are missing steps.

Worse, I myself forgot exactly how I have done that last time because I forgot to save a copy of the sample form I shared before.  Not to mention I actually do not use that activex DTPicker and only has done that blog last time out of curiosity.

Anyway, since I became curious again on how I did that last time plus maybe some may need it again, I experimented again on that problem and got it working again, LOL.  So I am recreating the steps needed to make it work in a grid in this blog.

Instructions on creating a sample form:

Create an empty form, on its load event, paste these: