And if something happened that displeased him, he used to say:
اَلْحَمْدُ لِلَّهِ عَلَى كُلِّ حَالٍ
Pronunciation
Alhamdu lillaahi 'alaa kulli haal
Meaning
Praise is to Allah in all circumstances.
Source: Hasan. Ibn Majah: 3803
Read the hadith
حَدَّثَنَا هِشَامُ بْنُ خَالِدٍ الأَزْرَقُ أَبُو مَرْوَانَ، حَدَّثَنَا الْوَلِيدُ بْنُ مُسْلِمٍ، حَدَّثَنَا زُهَيْرُ بْنُ مُحَمَّدٍ، عَنْ مَنْصُورِ بْنِ عَبْدِ الرَّحْمَنِ، عَنْ أُمِّهِ، صَفِيَّةَ بِنْتِ شَيْبَةَ عَنْ عَائِشَةَ، قَالَتْ كَانَ رَسُولُ اللَّهِ ـ صلى الله عليه وسلم ـ إِذَا رَأَى مَا يُحِبُّ قَالَ " الْحَمْدُ لِلَّهِ الَّذِي بِنِعْمَتِهِ تَتِمُّ الصَّالِحَاتُ " . وَإِذَا رَأَى مَا يَكْرَهُ قَالَ " الْحَمْدُ لِلَّهِ عَلَى كُلِّ حَالٍ " .
It was narrated that 'Aishah said: "When the Messenger of Allah (ﷺ) saw something he liked, he would say: 'Al-hamdu lillahil-ladhi bi ni'matihi tatimmus-salihat (Praise is to Allah by Whose grace good deeds are completed).' And if he saw something that he disliked, he would say: 'Al-hamdu lillahi 'ala kulli hal (Praise is to Allah in all circumstances).'" [Hasan (Albani). Ibn Majah: 3803]
Duas from IslamicAPI's Masnun Dua dataset (based on the Quran, hadith, Hisnul Muslim and Rahe Belayat). See the dataset