How to check the customer whether it is already exceeded credit limit or not, programmatically?

SOLVED

Hi all,

How to check the customer whether it is already exceeded credit limit or not, programmatically? Because I do not find any standard function to check it. I only find the exceptions, but I do not know how to trigger the exception during customer selection on my custom form. 

Thank you.