Originally posted by: Shaun
It was a relief to find this article.....after a much of struggling and brain straining
Thanx once again
ReplyOriginally posted by: Hassan
How can i make DialogBar as part of my MDI Window (i.e View)??
Originally posted by: V.Girish
Hi,
I have added a List Control and a button in my project and when i write this code when the button is clicked, it gives me an assertion on each line.
m_ListCtrl.GetDlgItem(IDC_ODBC_DSN_LIST);
m_ListCtrl.DeleteAllItems();
m_ListCtrl.DeleteColumn(0);
m_ListCtrl.InsertColumn(0, _T("DSN"), LVCFMT_LEFT, 350);
Whats the problem here ? I have also written the code for the CCmdUi as such.
void CDataBar::OnUpdateDriverList(CCmdUI *pCmdUI)
{
pCmdUI->Enable(TRUE);
}
This is for the List Control. Can you help me out on this ?
With Warm Regards,
V.Girish
Originally posted by: Srikanth Eswaran
hi,
first of all once you map your dialog to a class, when you enter class wizard, there is a section called member variables (the second tab in the class wizard). when the dialog class is chosen, it will display all controls including your edit control. add a member variable to your edit control ID, and keep it as a control variable rather than as a data variable. once you do that, you can always access ur edit control through this member variable. you could say
editctrl_memvar.SetWindowText("some data here")
for example.
remember to use UpdateData(FALSE) for initialising the edit control and UpdateData(TRUE) to retreive the data into these member variables that you had defined.
hope this helps.
srikanth eswaran.
Originally posted by: kim ji-su
I'm still in an early stage of my study.
So my program is very unexpert.
How I envy you!!
Please give me the recipe for Visual C++.
I'm glad to know your Korean.
I wish you Good Luck!
Originally posted by: C.Karlsson
How do I change a edit box which is readonly in a dialog bar, during runtime?
ReplyOriginally posted by: Hugh Hunkin
Here's how you can enable/disable buttons on a custom CDialogBar. Replace the OnUpdateButton1 function like so:
void CMyDialogBar::OnUpdateButton1(CCmdUI *pCmdUI)
{
pCmdUI->Enable(bButton1Active);
}
Make bButton1Active a boolean in your CMyDialogBar class. Now whenever you need to change the state, simply set bButton1Active to true or false.
My thanks to the two articles on how to customise the CDialogBar class and use buttons on it. They have certainly saved me a good amount of time trying to work it out.
Regards
Hugh
ReplyOriginally posted by: Chee Wee
I have created a 'NO' button in a dialog box which initially has 'OK' & 'CANCEL'. But when i execuated my program and press the buton,nothing happened. I assigned the button to exit a file when depressed.Do i have to write any functions to support it. Please advice.
Originally posted by: Prasad
Hi Folks,
I have a button in my CdialogBar Derived Class, I also have a Update Command UI handler which takes care of enabling the button, but I would like to enable and Disable the Button myself on some menu commands, so how do I send a Update UI message to the button in the Dialog Bar.
Prasad
ReplyOriginally posted by: E. Jim�nez
BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
Write OnButon to handle button click
Greetings
I don�t know how CInitDialogBar works. But if you want to enable buttons in MFC CDialogBar,just add the
folllowing line to CMainFrame MESSAGE_MAP:
ON_COMMAND(IDC_BUTTON,OnButon)<-This enables the button
END_MESSAGE_MAP
Reply