How to add image buttons?
-
Hi i am quite new in MFC but know C++ programing and done work in VC 6 using win32 console application now switching to MFC. So please tell me how can i add images button? How can i change the colors of dialouge boxes. I shall be very thankfull to you.
Regards: Xohaib Shirani
-
Hi i am quite new in MFC but know C++ programing and done work in VC 6 using win32 console application now switching to MFC. So please tell me how can i add images button? How can i change the colors of dialouge boxes. I shall be very thankfull to you.
Regards: Xohaib Shirani
CImage m; m.Load(_T("c:\\1.jpg")); m_Button.SetBitmap(m.detach()); but if you want to use of bitmaps you can use of LoadImage.
-
CImage m; m.Load(_T("c:\\1.jpg")); m_Button.SetBitmap(m.detach()); but if you want to use of bitmaps you can use of LoadImage.
-
Dear i tell you that i am quite new in MFC so plz guide me where i have to put this code CImage m; m.Load(_T("c:\\1.jpg")); m_Button.SetBitmap(m.detach()); ??
Regards: Xohaib Shirani
So you need to more info,Ok. First you must load your image with LoadImage or CImage class or GDI+,... After load your image you will be have a handle to that image file then you can use of this handle at control that you want to use it. For example I guess you have a Static control and you want to insertimage to it: //(1)Declare a variable of CImage #include "atlImage.h" CImage m; //(2) load image file (you need to path of file m.Load(_T("c:\\1.jpg")); //(3) set control to that image file m_Static.SetBitmap(m.detach());
-
So you need to more info,Ok. First you must load your image with LoadImage or CImage class or GDI+,... After load your image you will be have a handle to that image file then you can use of this handle at control that you want to use it. For example I guess you have a Static control and you want to insertimage to it: //(1)Declare a variable of CImage #include "atlImage.h" CImage m; //(2) load image file (you need to path of file m.Load(_T("c:\\1.jpg")); //(3) set control to that image file m_Static.SetBitmap(m.detach());
-
Do you have any idea to change the colors of dialoge boxes?? I ask too much question?? Hmmm... Sory bro need to learn... :-D
Regards: Xohaib Shirani
Yeah I have an Idea WM_CTLCOLOR is your answer. ;)
-
Hi i am quite new in MFC but know C++ programing and done work in VC 6 using win32 console application now switching to MFC. So please tell me how can i add images button? How can i change the colors of dialouge boxes. I shall be very thankfull to you.
Regards: Xohaib Shirani
Start by browsing this website. I know there are multiple articles on fancy buttons, and some on changing backgrounds for all sorts of things. Expand the "desktop development" part on the left, the look under "button controls", and "dialog and windows". It will take you a while to find what you are looking for, but you'll trip over many other good things along the way. Iain.
Iain Clarke appears because CPallini still cares.