I got curious enough to do some research. Found the website where Parrotmom got her info. But, also found out that "to the nines" is such very old slang that it refers to anything, not just dress. It means "to the ultimate". It is so old a saying that it predates long gloves and a bunch of other "guesses". And, it originated as Old English. Which makes it impossible to know to origin. I was amazed that a bit of slang could survive that long!