?
Solved

Button in CDilogBar

Posted on 1998-08-06
3
Medium Priority
?
245 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 200 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

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

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
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.

801 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