Solved

Change Gripper of Resizeable Dialog

Posted on 2008-10-14
2
512 Views
Last Modified: 2013-11-20
Hello,

is it possible to change the icon or bitmap of a mfc resizeable dialog? If this is not possible, is there a way to make a dialog resizable without the gripper, like with a own image /Icon/Button?

Thanks,

Ocrana
0
Comment
Question by:Ocrana
  • 2
2 Comments
 
LVL 5

Expert Comment

by:isprabu
ID: 22729437
Ocrana,
I am trying to understand your need. I think your primary objective is to change the icon of the dialog box in MFC. If this is true, it can be done.
Usually the icon files are available under ../res folder. You can change the icon for a dialog
1) either by editing the icon file
2) modifying the icon entry in the rc file (see below) - to point to your icon instead of the default.
You may have to recompile your rc file for the changes to take effect.

Hope this helps!
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDR_MAINFRAME           ICON    DISCARDABLE     "res\\TestApp.ico"
IDI_ICON1               ICON    DISCARDABLE     "res\\icon1.ico"

Open in new window

0
 
LVL 5

Accepted Solution

by:
isprabu earned 500 total points
ID: 22729534
In case, if your objective is to change/redraw the gripper, it can be done too. You can subclass the CControlBar class in your code and override its methods according to your needs. Mainly you have to override the DrawGripper method and the DoPaint method. You may also have to handle the OnNcPaint message.

Once this is done, in your application, use your derived class member variable.

You can also refer to this link:
http://kbalertz.com/843490/gripper-drawn-incorrectly-application-Windows-Visual-Styles.aspx

Hope this helps!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa‚Ķ
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question