This is how I did it:
Knit until the row that you want the button hole to start. Knit half of the stitches in the row. On the next stitch, attach a second ball of yarn (or use the other end if you are using a center-pull ball). Knit the second half of the row with this second ball of yarn. When you get to the end, just turn your work around and knit with that second ball, when you get to the middle, pick up the working yarn from the first ball (it is still attached) and knit those stitches. Keep working this way until the button hole is long enough. Don't be tempted to make it to long, or it might slip out while it is being worn.