How to adjust view brightness by programming

Hi All,

We know we can adjust view brightness by a tool from view border toolbar. But how to adjust view brightness by programming? Keyin are also accepted.

Thanks,

Xue