To understand the sensing behaviors of molecular fluorescent probes, lumazine (Lm) and 6-thienyllumazine (TLm) and their complexation with metal(II) ions ([(L)nM(H2O)m](2+), M = Cd(2+) and Hg(2+)) were examined by scalar relativistic density functional theory (DFT). A red shifting from L to [(L)nM(H2O)m](2+) was found. This is due to the metal affinity that stabilizes the LUMOs of [(L)nM(H2O)m](2+) greater than the HOMOs. Singlet excited-state structures of L and [(L)nM(H2O)m](2+) (M = Cd(2+) and Hg(2+)) were fully optimized using time-dependent DFT (TDDFT). Their fluorescent emissions in aqueous solution were calculated to be 371 nm (Lm), 439 nm (cis-TLm), and 441 nm (trans-TLm), agreeing with experimental values of 380 nm for Lm and 452 nm for TLm. Theoretical support is presented for a sensing mechanism of photoinduced charge transfer of the L probe. The mechanism of the chelation-enhanced fluorescence (CHEF) and the chelating quenched fluorescence (CHQF) is explained. Fluorescence amplification (for Cd(2+)) is due to blocking of the nitrogen lone pair orbital due to the stabilizing interaction with the vacant s-orbital of the metal ion, while fluorescence quenching (Hg(2+)) results from the energy of the LUMO of the metal ion being between HOMO and LUMO of the sensor. Effects of structure rearrangements on the fluorescence spectra of the sensors are insignificant. This proposed mechanism of metal orbital controlled fluorescence enhancement/quenching suggests a development concept in the future design of fluorescent turn-on/off sensors.