The actor, who played Richard 'Boner' Stabone' on the sitcom, was found dead in a Vancouver park yesterday after being reported missing last week.
It has been suggested that he was suffering from depression.
Writing on his account, Shatner - who starred alongside Koenig's father Walter in Star Trek - said: "My deepest sympathies to Andrew Koenig's family. I will grieve with them."
Milano posted a link to a webpage containing suicide warning signs on her own account, saying: "If you know someone suffering from depression, please do everything in your power to get them help. RIP Andrew."
Other Star Trek cast members to pay tribute included LeVar Burton, who said he was "offering prayers" for the family, and Wil Wheaton, who wrote: "He was only 41. My heart goes out to his family."
Holly Robinson Peete, who worked with Koenig on 21 Jump Street, wrote: "Rest With Angels Andrew Koenig."
Other stars to have paid their respects include Sarah Silverman and Marlee Matlin, who said: "Watching Walter Koenig's press conference about his son's death is heartbreaking. Don't ignore depression - recognise it and get help."