| | |
MFC help
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
Well you need to give us a starting point as to what you have, my suggestion is that you have an image placeholder thingy, and then change the source of it when each button is pressed, ofcourse I can't use any technical names because I dis-like MFC 
Chris

Chris
Knowledge is power -- But experience is everything
•
•
Join Date: Dec 2007
Posts: 359
Reputation:
Solved Threads: 69
Did you build the dialog with the vs2008 resource editor?
If yes, click the right mouse button while selecting the dialog in the resource editor and create a dialog class. After that double click the button and create an event handler as member of your new dialog class.
If yes, click the right mouse button while selecting the dialog in the resource editor and create a dialog class. After that double click the button and create an event handler as member of your new dialog class.
If you are forced to reinvent the wheel at least try to invent a better one!
Please use code tags - Please mark solved threads as solved
Please use code tags - Please mark solved threads as solved
•
•
Join Date: Jul 2008
Posts: 12
Reputation:
Solved Threads: 0
Im affraid im a little lost at the moment. I tried creating a new class, which i assume you meant a c++ class. But once ive done that and double clicked the button i dont quite know where to go, or what i should write in the class.
What i want is for each button to display a different picture so what would need to go in the class for selecting each pic?
What i want is for each button to display a different picture so what would need to go in the class for selecting each pic?
you need to write an event handler for each of those buttons. Inside the event handler is where you put the code to load and display the image you want. As I recall, to create an event handler function for a button just right-click the button and you will see the option(s).
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
•
•
Join Date: Jul 2008
Posts: 12
Reputation:
Solved Threads: 0
I understand the event handler side of things as the buttons I have are already being used to play a wav file once pressed, its just what I need to put in the class that was suggested.
I have 13 buttons representing notes on a piano keyboard and want to display like A, A#, B and so on in pictoral form and I have 13 images which are easy enough to display statically.
I have 13 buttons representing notes on a piano keyboard and want to display like A, A#, B and so on in pictoral form and I have 13 images which are easy enough to display statically.
The class that was Jencas previously mentioned was of type CDialog. He was trying to describe how to create an event handler, which apparently you already know how to do.
You said in your original post you want to "load and image" when you hit a button. All that involves is LoadBitmap()
You said in your original post you want to "load and image" when you hit a button. All that involves is LoadBitmap()
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
![]() |
Similar Threads
- How do i do chat program using MFC (Microsoft Foundation Classes) and Visual Basic? (Visual Basic 4 / 5 / 6)
- MFC Socket programming problem (C)
- newbie needs help, basic mfc stuff (C++)
- Quit abruptly in MFC app (C++)
- Using MFC in a Static Library (C++)
- MFC diagram maker type thing (C)
Other Threads in the C++ Forum
- Previous Thread: IDE in C++ - How to?
- Next Thread: Binary to floating point representation
| Thread Tools | Search this Thread |
api array based beginner binary bitmap c++ c/c++ calculator char class classes code coding compile compiler console conversion count database delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream int integer java lib linkedlist linker linux list loop looping loops map math matrix memory multiple news node number output parameter pointer problem program programming project python read recursion recursive reference return rpg string strings struct temperature template templates test text text-file tree unix url variable vector visualstudio win32 windows winsock word wordfrequency wxwidgets






