You can use a remote desktop tool like teamviewer or RealVNC or just remote desktop connection to take over the desktop of your desktop computer
if you want to physically hook it up to another computer, the simple answer is you can't. Although if you dissasemble the monitor and get the correct adapters you can modify a screen to work with another computer via VGA.