Viroj had to step down because he does not qualify as opposition leader because he did not run in the elections. The Constitution requires the opposition leader to also be an MP.
His resignation will be effective from Wednesday onwards.
The party will meet next Friday to select new executives.
It has been speculated that MP Sompong Amornvivat will replace Viroj, while Phumtham Wechayachai will continue as party secretary-general.