I was wondering how to hide static text and change it.
Im working on my first MFC app for homework and Im using a combo box with the selection of six shapes such as (Square, Rectangle, Circle, Cube, etc.) So when I select Square I want just the static text to say side: with a edit box next to it and if I select Rectangle the static text to say length: width: with two edit boxes
So I was wondering how to use my combo box to get the correct static text and edit boxes. I don't know if I need tabs or not.
this is my combobox handler but I can only change one static text
and I dont know how to hide it.
To hide/show any type of window, you use the ShowWindow method of CWnd (or the equiv Win32 call, if not using MFC).
1 2 3
CWnd* pWnd = GetDlgItem(IDC_STATIC_ONE); // NOT just IDC_STATIC (see below)
pWnd->ShowWindow(SW_HIDE); // or SW_SHOW
You should not use IDC_STATIC for static windows you want to update. It's a special resource ID (-1) for all static controls with fixed labels, to avoid having to define resource IDs which will never be used to update controls.
Instead, each static you need to change should be given it's own unique ID (well, unique for a given dialog)