Solved

Button in CDilogBar

Posted on 1998-08-06
3
239 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
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
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 be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

775 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