Assume that a web browser project has a Boolean variable named blnNavigated. The browser also has the Back & Forward buttons for users to navigate.

What I want is if a user clicks a link in a web page to navigate to another page, then blnNavigated should be set to True but if the user navigates using the Back or Forward button, then blnNavigated should be set to False. Setting blnNavigated to False can be done in the Back & Forward buttons' Click event function but how do I set blnNavigated to True if the user has clicked a link in the web page to navigate to another page?