iif i have a button on the screen that paints a rectangle over it once it's clicked i noticed you can still click on the spot and the button will appear. Is there anyway of deleting buttons, so that it can't be clicked again.
iif i have a button on the screen that paints a rectangle over it once it's clicked i noticed you can still click on the spot and the button will appear. Is there anyway of deleting buttons, so that it can't be clicked again.
I started out with nothing and I still have most of it left.
Check out EnableWindow().
Kuphryn
how do i use it
I started out with nothing and I still have most of it left.
EnableWindow(hwnd);
hwnd is the hwnd of the button... but that will only make the button disabled and not gone..
i think that maybe:
ShowWindow(hwnd, SW_HIDE);
should work better.. use SW_SHOW to show it again
it doesn't seem to work. Do i put it in WM_COMMAND:
I started out with nothing and I still have most of it left.
I think also you can use
getdlgitem(hwnd)->EnableWindow(false)
I am not sure of it .. anyone correct me if i am not right
EnableWindow takes 2 parameters:
To get rid of the button altogether, use DestroyWindow.Code:EnableWindow( hwndButton, FALSE ); // disable your button
Code:DestroyWindow( hwndButton ); // this destroys your button
it doesn't seem to delete them. Am i suppsoed to be putting them in WM_COMMAND:
I started out with nothing and I still have most of it left.
Put it wherever you want, as long as the window handle you're passing is valid.it doesn't seem to delete them. Am i suppsoed to be putting them in WM_COMMAND
oh yeah sorry about that, EnableWindow does take two parameters..
EnableWindow() will make the control not respond to user input but still be visible (appear 'greyed').
ShowWindow will make a control/dialog appear or disappear (and not respond if hidden).
>>if i have a button on the screen that paints a rectangle over it once it's clicked
Instead of painting the rectangle (in the WM_COMMAND, BN_CLICKED handler for IDC_THIS_BUTTON)
I would hide the button
ShowWindow( GetDlgItem(hWnd, IDC_THIS_BUTTON), SW_HIDE);
"Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
Friedrich Nietzsche
"I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
George Best
"If you are going through hell....keep going."
Winston Churchill