void SlideSetDlgItemText(const HWND hDlg, const int id, LPSTR szText) { const HWND hwnd = GetDlgItem(hDlg, id); // Slide (push) the old value off (down) AnimateWindow(hwnd, 200, AW_HIDE | AW_SLIDE | AW_VER_POSITIVE); // Set the new value SetDlgItemText(hDlg, id, szText); // Slide the new value on AnimateWindow(hwnd, 200, AW_ACTIVATE | AW_SLIDE | AW_VER_POSITIVE); // The docs say AW_BLEND (disolve) doesn't work for dialog items }
Programming Tips - Windows: Update the text of a dialog item with a slide transition
Date: 2024may26
OS: Windows
Language: C/C++
Q. Windows: Update the text of a dialog item with a slide transition
A. Use AnimateWindow() like this: