Coded UI Test can't access focus-visable button in winRow - c#

When recording CUIT in Visual Studio 2015 (C#), I click inside a WinRow (inside a property grid-view table) which enables the ellipse [...] button control to click and open a pop-up window. However, the button is only visible when the WinRow is selected. So on playback, the WinRow loses focus between steps and the button is no longer visible to be clicked.
Does anyone know how to keep the focus inside the WinRow to be able to see/click the button?

Well if the WinRow is defined in your UIMAp Designer file, then you should add a clik on it just before the click on the button to put again the focus on the Winrow first.
But you will have to handcode it in external cs file because any modification on the UIMap designer will be automatically removed at it first next update...
Note that a lot of recorded actions may not replay properly, mostly when you are in a dynamic behavior context, so you may have to handcode your automatisation to playback each needed actions.

Related

Opening Form (.cs) in Design View in Visual Studio Shows Unsaved Changes Immediately

I have a form in a C# project that behaves oddly when opened in "Design" view. Whenever I open the form in "Design" view, it immediately puts an asterisk (*) beside the name of the form on its tab. If I close it without having made any changes, I am prompted to save the changes. Only one form does this.
If I open the code for the form directly, it does not behave this way. If I open the designer code directly, it does not behave this way.
However, there is one odd sequence that I can replicate:
Open the designer code (shows no asterisk)
Open the form in "Design" view (now both tabs have an asterisk)
a. If I try to close either tab now, I am asked to save changes
b. If I close Visual Studio, I am asked to save changes for both tabs (or all 3 if I had both the designer code and the form code open before opening the form in "Design" view).
Switch to designer code tab. When I do this, the "Undo" button enables and I have the option to undo "Designer Generated Code". BUT, the asterisk goes away at this point for only the designer code tab.
a. If I undo the changes, copy the code, redo the changes, and compare the code, they are identical.
I can now close the designer tab without being asked to save changes. The "Design" view tab still has an asterisk and asks to save changes, though. It also still has the "Undo" button enabled with the option to undo "Designer Generated Code"
How do I stop these phantom (not-actually-) changes from being (not-actually-) made when I open the form in "Design" view?
Note: I have nothing fancy or non-standard about my setup. Single developer on same machine every time, everything saves to VS's default locations, no 3rd party anything of any kind involved with VS.
When you work with form designer it use CodDom to generate code in Designer.cs file.once you open up the designer and designer.cs file. the operation you perform while designing the form UI CodeDome will generate a code in a designer file and it will show the * sign.
To make it Short at the end there is a designer.cs file which will actually reflect the changes in the form designer.

C# How can I separate a tab from tabcontrol like Firefox or Google Chrome?

I add a tab to my tabcontrol with a buttonclick and I can close these tabs with the middle mouse button. Now I want add that I can separate the tabs like Chrome or Firefox. For that I must click down the mouse and move them out to separate which handler is that or how can i realize that?
Update
I use Visual Studio 2015 with Winforms
I think what you should do is create a new control on click, one that has all the children of the tab you want to separate (and then dispose the old tabwindow control). Then when you have this separate control, you can implement dragging, and handle a drop on the tab control you want it to add to. The dropping handler would contain code that transforms the new control back to a tabwindow, and adds it to the tabcontrol.

Visual studio oddity toolbox click drag

So, I just installed dotConnect and in the wpf editor, if I select say a button then click and drag it to the window under construction in the designer, the option to select another control already there is lost. After that every time I click in the designer window it will place another button instead of highlighting the component or simply the last item I click and drag.
It's as if the toolbox is not letting go of my mouse function. I'm not sure if the dotConnect is related or not but it is the last change I made to VS since it started.
Has anyone dealt with this and know how to fix it?
Edit:
I found that if I click and drag from the toolbox to a restricted area (for instance the solution explorer) and drop it, it returns to normal. I have to do this every time I click and drag a new control into the design window.
After the update as TrevorBrooks suggested, the problem went away.

Visual Studio: Typing code vs. drag and drop from the control menu

I tried creating a gridview by typing code using another block of code on a different page as an example. I found that, when I ran the program and clicked the Edit button on a row, the fields did not change into textboxes for editing. I did have code to handle the Row Editing event.
In an earlier project I found that I had to double-click the Row Editing event in the Properties window for a gridview to create the event handling code. Typing in that code in the separate aspx.cs file did not work.
I am working with ASP.Net / C#.
What is going on with Visual Studio when I do drag and drop from the control menu as opposed to just typing in code? I am assuming it is adding something that I am missing when I am just typing.
Does anyone else have other examples that didn't work when they typed code that I should watch out for?
Even if you did a mighty good job copying the HTML, you likely still missed a few properties. That's because the GridView component comes with a bunch of so-called Design-Time properties that can (only) be configured from the Properties panel in Visual Studio.
I think you'll find that dragging a control from the toolbox onto your web form will set the control's design-time properties to a specific set of default values. This does not happen when you type the HTML by hand.

Run Action Upon Mouse Click and Mouse Release

I am working on a Windows Form C# project that requires running code when a user clicks down on a button, then waiting, and running a different set of code when the user then releases the mouse button. I have tried Button1.MouseDown and MouseUp as something that was suggested when I did a search for this information, but neither of these worked.
Does anyone know how to do this?
Thanks.
In visual studios, try clicking on the button and in properties, view the "Events" menu. You may have to scroll down and find Events "MouseDown" and Events "MouseUp".
Double click on each of this, which will load the class to work with.
Inside of those, you may add your code.
You can create a timer if you wish running at 100ms and if the user clicks the button and holds, then the timer goes and the moment he releases, inside that, you could have timer1.stop();

Categories

Resources