I'm going to assume you are using XNA in a WinForm, but you haven't given enough information to know for sure if that is true.
If so, you need to set the
Mouse.WindowHandle property to your game window handle (maybe Game.Window.Handle, I can't remember offhand). Also see this
thread for issues when you open and close dialogs.