When my dog Harper had open-heart surgery this spring, she seemed to be feeling better just a week later. Still, we were under orders from the vet to keep her quiet for 90 days. That wasn't easy.

Baby gates, steps to the furniture and closed doors became the rule in our home. We carried Harper up and down the stairs several times a day and lifted her onto the bed at night so she wouldn't try to jump up on her own while we were sleeping.

She looked disappointed every time we left the house to go on a walk and didn't take her along. And nothing could stop her from twirling and dancing at mealtime.

Making sure that a pet gets the rest it needs for weeks or even months after an illness, medical treatment or surgery can be a trial for pets and their owners. It's impossible to explain to your pet why it can't run and jump like usual. Nonetheless, it's a must to ensure a safe and effective recovery.

Reining in a pet's activity level calls for lots of supervision and a little creativity. Here's how to survive, whether your dog or cat must be confined for three days or three months:

• Baby gates and exercise pens are your friends.

In the house, use baby gates to keep dogs from having the run of the house and climbing stairs. You can also use an indoor kennel to confine a healing pet. Let them outdoors into an exercise pen to relieve themselves, then they can go right back in the crate.

• Tether your pet.

If you are home, you can keep your pet on a leash. That's what I did to keep my former foster dog calm after his injections for heartworm disease. (The drug causes the worms to die and disintegrate, so dogs must remain inactive during the three-month treatment period to ensure that no potentially fatal blockage occurs in the pulmonary vessels.)

• Close doors.

Harper usually spends her day napping beneath my desk. It was easy to forget that she has definite ideas about when bedtime should be. We would go look for her, only to find that she had already jumped on the bed on her own. We had to start keeping the bedroom door closed all the time.

• Use pet steps to furniture.

Portable steps come in handy when you want your pet to have access to a sofa, bed or other piece of people furniture. We placed steps at one end of the sofa and blocked off the rest of it so that Harper could only use the steps to get up.

• Ban boredom.

You likely won't be able to play fetch, but you should still interact with your pet as much as possible. Work on touch games, such as teaching your dog to touch your hand with its nose. To keep your pet's brain busy while he's confined, put food in an enrichment toy so he has to do a little thinking to get at it.

• Be patient.

Before you know it, your dog or cat will be ready for action again.