How to provide the association between the dialog and a button? - visual-c++

Please Kindly Help in Making the association between the Dialog and the button in vC++

If by "the Dialog" you mean "the Dialog class" then I assume you're trying to access a dialog button from within the Dialog class for that dialog. If so, then try right-clicking the button in the resource editor and select "Add Variable". This will then add a variable to the dialog class which is associated with the button in the dialog.

Related

nsoutlineview: right click without invoke "selection did change" delegate method

as the official "DragNDropOutlineView" sample project,
if i have already selected an item,clicked right button for menu,the right clicked item
will be selected & marked with a blue border,but selectionDidChange method was not invoked.
how did it implement?![enter image description here][1]
answer the question myself,
we can not implement this by coding, instead, we can create a menu in the interface builder, choose the table view or outline view, link the "menu" outlet to the menu you created just now.
now when you right click the item , it won't invoke the selectionDidChange notification.

how to add textfield in dialog box

I wish to save information entered by user on my form using a dialogue box.
Dialog d=new.dialog();
d.show("save info","Do you want to save?","OK","Cancel");
Can i add a textfield (edit-textbox) in the dialog box for the user to enter the desired name (alphanumeric) before pressing ok. and if not interested he can simply cancel. I will be saving the information as a hashtable in an object with user selected name.
If it cannot be done in dialog what is the next best way. pl add a piece of code or tutorial for better understanding.
Its a mobile app developed in Codename one. Therefore, even LWUIT users can help.
thanks
try this:
Textfield myTF = new textfield();
Dialog abc = new Dialog();//how ever u wish to initialize it
abc.addComponenet(myTF);//add text field to dialog
abc.show();//show dialog.
Note: Dialog extends a Form. so u get the propertied of a form in your dialog.

Updating toolbar button state MFC

I have a dialog in MFC application, which is having menu-bar. Now I have created a toolbar in that dialog using the same command ID which is in the menu-bar.
I use to update the menu-item's state and makes it enable/disable as per some check in ON_UPDATE_COMMAND_UI, When I clicks on the menu. But for toolbar I didn't gets these calls to update it's state, If it should be enabled/disabled.
Moreover I didn't have any notification when the test fails and I to disable the item.
Is there some alternative for doing this?
Thanks
call to ON_UPDATE_COMMAND_UI is only coming when I click on the toolbar button.
Use MFC in a dialog can be frustrating.
I suggest you disable the toolbar button directly when changing state to the variable that will enable / disable the menu:
void CtestDlg::OnBnClickedButton_DisableSomeControls()
{
command_menu_1 = !command_menu_1;
m_ToolBar.GetToolBarCtrl().EnableButton(ID_COMMAND_TEST, command_menu_1);
}
is not very elegant, but it works!

MessageBox in c#.net

How can I display a messagebox like the Microsoft error message in C#.net
The message box should have an OK button and an Show details button.
The Show details button should display the error details. Is there a built in class for this?
Thank you
There isn't a standard dialog to do this; you'll have to create your own Form and display it with a ShowDialog.
You can have the Click event of the 'Details' button change the size of the form and toggle the visibility of the details text.
There is no built in class available to do this.
you can create a custom form with Ok and Show Details button.
set height and width as per the need.
handle click event for the button with appropriate code.
create an instance of this form and use ShowDialog() method to show the dialog box

MFC feature pack - how to update the property grid control

I'm new to MFC and is a bit confused with the new features of "MFC feature pack." Through the wizard I now have an application that looks like an IDE - has a dockable file explorer on the left side and a dockable properties window on the right side. I'm able to get the selected items on the file explorer window through ON_WM_LBUTTONDBLCLK and GetItemText().
Question:
Properties window should be "updated" after clicking an item in the file explorer window. Ex. I click an item "button" in the tree control, properties window should show "image", "font", and "color" How can I do that? How do you update the contents of the propertygridCtrl?
To fill the property grid, look at the wizard-generated content. You'd set up a handler for the 'item button' clicked event, clear the grid content, fill it again. Seems an obvious answer so maybe I misunderstood the question.
I don't understand where is your difficulty. Just have a class derived from CMFCPropertyGrid, add a public member function on it to Update its data, having one parameter. Call that function from the file explorer window, having the selected element as the parameter.
Maybe you are choosing the wrong to handle the fact of the user is changing the selected item? I don't know what class is your "file explorer" control, but I suggest you to use something to do with "Item changed" instead of "Click" or "LButton", as the selected item can change by other means, namely arrow keys!

Resources