Microgrid is a independent and controllable system which is composed by load and miniature power. It provides for the local power and energy. The complex control of microgrid is implemented by microgrid inverter. This paper introduces two operation modes of Grid-connected and Grid-disconnected for microgrid inverter. On the Grid-connected operation, it uses hysteresis current tracking, by adjusting the output current to the grid to achieve energy transmission. On the Grid-disconnected operation, it uses voltage close loop control, by adjusting the output voltage to ensure stable load voltage. When the gird fails or recovers, microgrid inverter can switch smoothly between two modes of Grid-connected and Grid-disconnected operations. The simulation results show the feasibility and effectiveness of control strategy.