Yes, they got billions of DKK in cash for selling Dong Energy and now Nets too (but of course, and interestingly, only a fraction of what they tend to get sold for a few years later), at the cost of giving up political power - democratic power - over our energy supply, environmental strategy and credit cards, and the surplusses/deficits that the state could have gotten from the companies in the future.
If the state really wanted money though, it'd set a small transaction tax or something like that on the Dankort, like there is on many other payment cards. I'm not saying I'm in favor of this - but I'm pretty sure that would be a better solution, if you need money, than to sell the company once and for all, especially in the long term.
Sadly, the Danish constitution doesn't allow nationalizing companies without compensation, and there's no way the state could possibly pay compensation if it nationalized the large companies or banks. To change that, the parlament would have to approve the change - then a new one would have to be elected - and approve of the change again - and then a referendum, with at least 40% of people voting, would also have to approve it.
This has happened a few times, when women became allowed to vote and a few years ago when males and females became equally allowed to inherit the royal throne. But I don't for a second think it would be realistic that the parlament would change the constitution so companies could be nationalized without gigantic compensations in the near future.
The only thing the socialist parties can try to do while waiting for the revolution is to create new state companies and prevent privatizations. And our current 'socialist' government is hardly doing either.