I'd like to create a bar which will have a mixture of the tool buttons and controls (combo, pushbutton, edit, etc).
The CToolBar class will work for the tool buttons but the job of implementing the controls is too involved.
The CDialogBar class will work for the controls but how do I get the tool buttons to work? I've tried a standard button with the BS_ICON style; two problems: 1) button is 16x16, icon is 16x16 but the display lops off part of the icon and 2) how do I get the button to stay "depressed"? I've tried a standard button with the BS_BITMAP style but it: 1) loses the 'transparency' feature of icons, and 2) I still cannot get the button to stay "depressed". The BS_PUSHLIKE style does cause the button to appear to be pushed in on mouse click but does not remain pushed in.
The CReBar class will allow for the wrapping of a CToolBar in one band and the CDialogBar in another band but I'd really like to mix the tool buttons and controls in a more logical order.
So, the upshot is, I'd like to use the CDialogBar with BS_ICON style if the following problems can be fixed:
1) how do I display the full (standard sized) icon?
2) how do I simulate the icon being "depressed"?
set BS_OWNERDRAW style, and draw yourself in CButton::DrawItem overridden function (you need in this case to create your own class derived from CButton), or an easier alternative is to use CBitmapButton class.
I have a project to do that requires me to add the "mouse event". The directions says, "Visual C++ doesn't give a control to capture the mouse event.In Design view select application form, under properties window click on an icon event shown as lightning bolt."
I follow the direction but can't find the lighting icon. Could someone help me.
Could someone help me to understand, " When the code in a try block does not throw an exception, which of the following is false?"
1. all the catch handlers immediately following the try block are skipped
2. execution resumes with the first line of code after the catch handlers
3. a default exception is thrown
4. none of the function calls within the try block threw an exception
If I would know what a try block is, I would be able to answer the question. I wrote could someone help me to understand what the try block is and give the 4 choices. I didn't ask for the answer, but I ask for understanding the concept. You could it give suggestion what try block. Thanks David
While it would be very easy to tell you the answer to your homework problem, it wouldn't help you much to do so. Instead, go to Bjarne's book (The C++ Programming Language) and use the index to look up "try-catch", "exceptions", and "exception handling".
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
1 is true
2 is usually true, however I think it's legal to goto out of a try block, in which case execution resumes at the target of the goto
3 is false - there's no such thing
4 cannot be determined. A function called in a try block may have thrown an exception, but contained a catch that caught and processed the exception.