  Using Monte Carlo generators of the PYTHIA model for hadron-hadron collisions
and a multi-phase transport (AMPT) model for nucleus-nucleus collisions, the
longitudinal boost-invariance of charge balance function and its transverse
momentum dependence are carefully studied. It shows that the charge balance
function is boost-invariant in both {\it p}+{\it p} and Au+Au collisions in
these two models, consistent with experimental data. The balance function
properly scaled by the width of the pseudorapidity window is independent of the
position or the size of the window and is corresponding to the balance function
of the whole pseudorapidity range. This longitudinal property of balance
function also holds for particles in small transverse momentum ranges in the
PYTHIA and the AMPT default models, but is violated in the AMPT with string
melting. The physical origin of the results are discussed.
