Click here to Skip to main content
15,917,176 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralPrinting from multiple views Pin
slackboy23-May-02 18:30
slackboy23-May-02 18:30 
GeneralRe: Printing from multiple views Pin
Jonathan Craig24-May-02 3:31
Jonathan Craig24-May-02 3:31 
GeneralRe: Printing from multiple views Pin
slackboy25-May-02 19:50
slackboy25-May-02 19:50 
QuestionHow to add a shortcut to the toolbar of IE? Pin
George Ma23-May-02 16:44
George Ma23-May-02 16:44 
AnswerA sample ... Pin
Karavaev Denis23-May-02 19:24
Karavaev Denis23-May-02 19:24 
GeneralRe: A sample ... Pin
23-May-02 19:58
suss23-May-02 19:58 
Questionhow to send a virtual key in a service Pin
23-May-02 16:19
suss23-May-02 16:19 
GeneralCustom Buttons Using CDialogBar, CButton, and CControlBar :: MFC Pin
valikac23-May-02 13:22
valikac23-May-02 13:22 
Hi.

I am trying to implement a basic static toolbar. Here is the design.

- create a dialog box
- add a button (just consider one button for now)
- use CDialogBar to create the dialogbar at construction
- use GetDlgItem(IDC_Button) to get a pointer to the button

Okay. The design above works well. I have two major problems. First, the button does not look like a normal button. The button looks flat and is out of focus. Secondly, I am not sure where to add the message handler for the button.

What I have done is difficult to explain. I hope the brief explanation above is enough. Here is a simple code for it.

-----
CDialogBar m_MyDlgBar;
CButton *m_pButton;

int CMainFrame::OnCreate()
{
...
if (!m_MyDlgBar.Create(this, IDD_MYDLG, CBRS_BOTTOM, IDD_MYDLG))
{
TRACE0("Panel creation failed");
return -1;
}

m_pButton = reinterpret_cast<cbutton *="">(m_MyDlgBar.GetDlgItem(IDC_BUTTON));

ShowControlBar(&m_MyDlgBar, TRUE, FALSE);
-----

So basically, I need to somehow set the button to look like a normal button. Secondly, I need to know where to add a message handler for the button.

Thanks,
Kuphryn
GeneralRe: Custom Buttons Using CDialogBar, CButton, and CControlBar :: MFC Pin
valikac23-May-02 19:29
valikac23-May-02 19:29 
GeneralPrinting C/C++ source code in color Pin
SAK23-May-02 12:38
SAK23-May-02 12:38 
GeneralRe: Printing C/C++ source code in color Pin
Martin Ziacek23-May-02 19:34
Martin Ziacek23-May-02 19:34 
GeneralFile->Open Pin
Stew23-May-02 12:03
Stew23-May-02 12:03 
GeneralRe: File->Open Pin
Stew23-May-02 12:29
Stew23-May-02 12:29 
GeneralPrinting Question Pin
Stew23-May-02 10:31
Stew23-May-02 10:31 
GeneralRe: Printing Question Pin
Stew23-May-02 11:18
Stew23-May-02 11:18 
GeneralRe: Printing Question Pin
Jonathan Craig23-May-02 11:18
Jonathan Craig23-May-02 11:18 
GeneralSetWindowsHookEx Problem...... Pin
DeepBlue23-May-02 10:06
DeepBlue23-May-02 10:06 
QuestionCan RDS.Dataspace be used from Visual C++ Pin
Jesper Mandal Hansen23-May-02 9:45
Jesper Mandal Hansen23-May-02 9:45 
GeneralWebBrowser control Pin
Sanjeev Kumar23-May-02 9:15
Sanjeev Kumar23-May-02 9:15 
GeneralRe: WebBrowser control Pin
Ravi Bhavnani23-May-02 12:17
professionalRavi Bhavnani23-May-02 12:17 
QuestionWhats wrong with this code? Pin
Mazdak23-May-02 8:52
Mazdak23-May-02 8:52 
AnswerRe: Whats wrong with this code? Pin
Joaquín M López Muñoz23-May-02 8:59
Joaquín M López Muñoz23-May-02 8:59 
GeneralRe: Whats wrong with this code? Pin
Mazdak23-May-02 9:21
Mazdak23-May-02 9:21 
GeneralRe: Whats wrong with this code? Pin
Joaquín M López Muñoz23-May-02 9:31
Joaquín M López Muñoz23-May-02 9:31 
GeneralRe: Whats wrong with this code? Pin
Mazdak23-May-02 9:41
Mazdak23-May-02 9:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.