Missing wiring in CCheckListBox? - checkbox

I can't seem to programmatically query whether a check box is checked or not.
Using Visual Studio's GUI Builder I dragged a "Check Box" from the Toolbox to my dialog. In Properties Editor I gave it an ID of IDC_MY_CHECK. It's just one check box, not a list of check boxes.
In my controller, in the callback for pushing a submit button I have the code
CCheckListBox* myChk = (CCheckListBox*)GetDlgItem(IDC_MY_CHECK);
int state = myChk->GetCheck(0)
I run it and check the box and click the submit button, but state is 0.
Did I wire it up incorrectly, or is a "Check Box" in the GUI editor not a CCheckListBox the way I think it is?

Figured it out. It's not a CCheckListBox at all. It's a CButton.
CButton* myChk = (CButton*)GetDlgItem(IDC_MY_CHECK);
int state = myChk->GetCheck()
works.

Related

CodedUI Test HtmlButton disabled in JS

I'm having an issue in Coded UI where a HTMLButton is disabled until the user selects an item in a list box. At which point the button is enabled via javascript. The problem I'm having is that the recorder is not picking up the change. When I run the test I get a "ActionNotSupportedOnDisabledControlException". I've tried the WaitForControlEnabled, Find and WaitForCotrolReady methods but nothing seems to work. Is there a way I can make the button enabled in code?
First you need to check control is disabled or not visible.
I have faced same issue where control was hidden under another control, so it was not visible directly.
You can enable button by executing Javascript from your Coded UI test/script.
Javascript Code:
document.getElementById<ID>.disabled = false;
document.getElementsByClassName<>.style.visibility='visible';
Test/Script Code:
this.UIMap.Window.ExecuteScript(<above / your JavaScript>);

Mobile command button issue

In the iPhone ADF mobile app I have a textinput field and a "Save" commandbutton. In the properties for the commandbutton I have the disabled condition set (like if the textinput field is null). This works fine. In the beginning the save button is disabled and when I enter any text with a keyboard the button is automatically enabled and vice versa.
The only issue is my users can enter the text via voice too. If they use the voice to fill the text field - still the save button is not enabled. As soon as they change anything using key board it is enabled.
How do I set the command button properties to check this please?
In the InputText properties there is a property called Value Change Listener,
add a java method to it to check if the value is null or not then try one of the below:
Reset the InputText value as this will fire the propertyChangeListner and may activate your button.
Disable or Enable your button in code according to the value.
Hope this help.

WPF trigger code behind button to display second form

I am a WPF novice.
I have created a form containing a combo box with which to choose a multi-field key value(populated from an XML data file).
I have also created a second WPF form which is available to display all field values from the record associated with the multi-field key value chosen from the first form.
I need to be able to click a button which will cause the second form to be displayed, with all fields filled in which are associated with the chosen key field values.
How do I go about writing such an event trigger using C#?
couple of steps (this is not really MVVM, BTW) ...
first, add a click handler to your button
second, in the click handler code, instantiate your new form
third, set the data context, etc for the new form
forth, show the new form by calling .Show()
in your xaml add a click handler to the button in question....
<Button Click="myClickHandler"/>
in visual studio, you can right click the text in the click="" and choose to navigate to the handler and visual studio will generate the code for it for you.
in your click handler, in code behind, do something like this....
public void myClickHandler(object sender,EventArgs)
{
MySecondForm form = new MySecondForm();
form.DataContext = theDataContextIWantToSet;
form.Show();
}

Check button like in "solution explorer" in visual studio

there's "show all files" check button in solution explorer tab in visual studio. How can I make such a button ? /* give me a class */
My manager wants exactly the same button and it's behavior ..
Or is it not "free" button ?
Edit: I see some people didn't understand my question. Some explainations:
I need a check button exactly like in visual studio (like "show all files" button). I need a "check" bahavior when I clicked a button it shows some half-transparent blue layer on a button image. And I need a mouse hover behavior when a half-transparent blue layer added to a button image. I hope you understand my english
It is a button. Create a button, assign an image (if you want the pretty picture) and put an OnClick event handler in. In your event handler, you'll need to add the code to do what is required.
Solution Explorer provides you with an organized view of your projects and their files in treeview.You can do this
by implementing your own treeview and showing all the files and folders inside the root folder.
you can check this thread to get started with treeview
I need a check button exactly like in visual studio (like "show all files" button).
I'm assuming you need a button that looks like the button in VS, not a button that behaves like the button in VS.
It's a toolbar button. Add a Toolstrip to your form, add a button to the toolstrip, set the CheckOnClick property to true and add a custom image.

How to interact with other application forms

I am looking for a way to once I see a form by Name add a button to that form and when the user clicks the added button, pull information from the form. For example, if I see the for title - "Stack Overflow - Wnidows Internet Explorer" I would add a button "MyButton" on the form, and when that button is clicked, I would "pull" the information from the "search" box. It should work on Web or Win forms.
Any help would be greatly appreicated.
I found my answer
You need to get the window handle to the form in question.
To put the button on another form you need to create the button and set its owner to the other window and set the buttons window position.
You can use the same window handle to enumerate the child windows to get the text if its an edit control.

Resources