The simulated electronic absorption spectra of (BN)nC(18-2n) (n = 1-9) showed that their absorption bands lie in the ultraviolet range of 125 to 400 nm, indicating the transparency of these molecules in the visible light region. The maximum absorption wavelengths of the molecules continuously blue-shift with the replacement of C-C units by B-N groups, and their absorption intensities increase first and then decrease. Taking (BN)4C10 as an example, the hole-electron analysis of its crucial excited state showed that holes and electrons are all mainly distributed on the C-C fragment while the B-N units has almost no isosurface, which indicates the localized electronic excitation characteristics of the molecule. The hyperpolarizability (β*(∞)) of (BN)5C8 estimated by the two-level model is the largest, which is different from that calculated by the coupled-perturbed Kohn-Sham (CPKS) method, indicating that the excited state contributing to the first hyperpolarizabilities of (BN)nC(18-2n) (n = 1-9) is not only the crucial excited state.