With the arrival of 5G, the wireless network will be provided with abundant spectrum resources, massive data transmissions and low latency communications, which makes Vehicle-to-Everything applications possible. However, VANETs always accompany with frequent network topology changes due to the highly mobile feature of vehicles. As a result, the network performance will be affected by the frequent handover. In this paper, a seamless handover scheme is proposed where the Software-Defined Networking (SDN) and Mobile Edge Computing (MEC) technologies are employed to adapt to the dynamic topology change in VANETs. The introduction of SDN provides a global view of network topology and centralized control, which enables a stable transmission layer connection when a handover takes place, so that the upper layer performance is not influenced by the network changes. By employing MEC server, the data are cached in advance before a handover happens, so that the vehicle can restore normal communication faster. In order to confirm the superiority of our proposal, computer simulations are conducted from different aspects. The results show that our proposal can significantly improve the network performance when a handover happens.