Solved

Button in CDilogBar

Posted on 1998-08-06
3
235 Views
Last Modified: 2010-04-02
Hi experts.
I'm developing my app using VC++5.0 in WindowsNT4.0 SP3.
I installed a button control in a CDialogBar with associated handler.
But the button isn't enabled during runtime.
Can anyone let me know why and how to enable it ?
Thanks in advance.
0
Comment
Question by:okg
3 Comments
 
LVL 1

Expert Comment

by:arun_ta
Comment Utility
Try the following steps:

1.In resource editor, take the dialog bar and set
  Style = Child, Border = None, Visible = unchecked.

2.Declare the object as : CDialogBar myDlgBar;

3.Add dialogbar object creation code in appropriate member function.
eg. in OnCreate() of CMainFrame class as: myDlgBar.Create(this,IDD_MY_BAR,CBRS_TOP,ID_MY_BAR);

Note: ID_MY_BAR is the dialogbar's control window ID, which should be in the range 0xE800 - 0xE820.  


   
0
 

Author Comment

by:okg
Comment Utility
Dear arun_ta
Thanks.
But it doesn't help.
0
 

Accepted Solution

by:
TangCheng earned 100 total points
Comment Utility
You must add WM_COMMAND message for this button in your App or View or Document's class.
You can see the button same as normal menu message.
When you push the button, the WM_COMMAND message will be active.

eg.
The Button ID is IDB_BUTTON1

BEGIN_MESSAGE_MAP(CMyApp, CWinApp)
..
ON_COMMAND(IDB_BUTTON1,OnButton1) //Add This Line by yourself
END_MESSAGE_MAP()

void CMyApp::OnButton1()
{
    ..... //Add your code.
}
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now