Click here to Skip to main content
15,888,984 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

How to hide the button in MFC using his ID..
Posted
Comments
Lakamraju Raghuram 2-May-12 13:20pm    
Reason for my vote of 1
Try google, before banging here.

Check out here for GetDlgItem
http://msdn.microsoft.com/en-us/library/77d16yhw(v=vs.80).aspx[^]

As you can see, this returns CWnd* and check for ShowWindow method here
http://msdn.microsoft.com/en-US/library/72szh9c7(v=vs.80).aspx[^]

This is spoon feeding, which I hate.
 
Share this answer
 
Comments
Nitin R G 26-Sep-14 5:08am    
showwindow(SW_HIDE) it is disabling the button, but the image which is loaded to the button is not hiding...any solutions ?????
Hope this works.
C++
GetDlgItem(IDC_EDIT1)->ShowWindow(SW_HIDE);
 
Share this answer
 
Comments
@BangIndia 2-May-12 10:05am    
Gives error
left of '->ShowWindow' must point to class/struct/union
Lakamraju Raghuram 2-May-12 13:17pm    
what is your problem. I don't see any trouble in my workspace
Nitin R G 26-Sep-14 9:52am    
showwindow(SW_HIDE) it is disabling the button, but the image which is loaded to the button is not hiding...any solutions ?????

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900