Solved

Button in CDilogBar

Posted on 1998-08-06
3
242 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 1

Expert Comment

by:arun_ta
ID: 1169519
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
ID: 1169520
Dear arun_ta
Thanks.
But it doesn't help.
0
 

Accepted Solution

by:
TangCheng earned 100 total points
ID: 1169521
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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 …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

696 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