Although Tisha B’Av is a day of great mourning, tradition nevertheless associated with it an element of consolation. There is embedded in the destruction the hope of future redemption. A famous story in Tractate Makkot (24b) tells of Rabbi Akiva laughing as he walked through the ruins of Jerusalem while his friends were all weeping bitterly. He explained his laughter by saying that having seen how God had fulfilled His promise of destruction, he knew He would fulfill His promise of rebuilding. Thus Akiva had confidence that Jerusalem would be rebuilt.
The idea that Tisha B’Av itself contains elements of future redemption explains the tradition that the Messiah will be born on Tisha B’Av. Similarly before Tisha B’Av, we read three haftorot dealing with destruction and immediately after Tisha B’Av, beginning with Shabbat Nahamu, the Shabbat of Consolation, we read seven special haftorot dealing with consolation.