You have not provided any context for this statement. Context matters - here and in most other places.
If this is to be used in instructions to the user of an application, perhaps on a computer screen, I would use Parla's suggestion.
If this is to be written in technical documentation, I would write "Clicking the OK button closes the warning dialogue." (I prefer the traditional spelling, dialogue, but the shorter dialog is common and is not an error.)
If this will be used somewhere else, tell us, since some other way of saying it may be better. You know what this is for. Please don't keep it a secret.