i have wpf application, in my application on one editor user can add n number of user control and for each user control he can edit or enter properties, i want to add redo undo functionality for this editor,i.e. for add user control remove user control, move user control edit user control properties at run-time.
Run the program and type some text into the TextBox before clicking the two buttons. To see the way that multiple changes can be undone, type some text, click Undo and then Redo, then add extra text. It will now be possible to undo twice.
Related
I have a user control and i can drag the user control to form1 designer for example and then see some properties and change the properties settings :
on the right is example of what i want it to look like.
the bottom white with the text Click Me should be a button that i can press either before running the program or at run time and when clicking on it to save some properties values in the user control.
This is a link for the user control code :
How to animate dots in UserControl Paint event?
so each time i'm dragging the user control to form1 designer in the properties window i will have a ui button that i can press on and save the user control settings like the interval value or the dot color or dotActivecolor and then when i will drag the user control over again it will be loaded with the saved values.
if a button is too complicated maybe to add another property in the user control code type bool and if the flag is true it will save automatic any changes to the user control properties and if the flag is false it will not save.
I have a user control that have a number of textboxes and comboboxes contained in it. These user controls are programmatically created and placed on a form. The final user of this application want the ability to press enter an instead of going to the next child control in the usercontrol, they want to go to the equivilent textbox in the next usercontrol.
So essentially i want "Enter" to take focus from usercontrol1.textbox1 and place it in usercontrol2.textbox1.
I am creating an application in which i have a user control that can be added by user dynamically any number of times. Form also contains some other controls.
Suppose he has added the control 10 times.
Requirement:
1) When the control is selected, it should be highlighted and when the
other control is selected then the previous control looses the glow.
2) User can select multiple controls at the same time. Now all the
selected controls should be highlighted and the selection has to be
made with ctrl key.
There is also a possibility of moving the controls on the form.
What I have achieved:
1) I am able to add multiple controls dynamically.
2) I can change the location of one control dynamically.
3) I am able to highlight the control when it is clicked, but not able
to un-glow it when user has clicked elsewhere. Need to know which event of User control can be used for that. -- Got the solution for this. On mouse click i made the focus on the control and then handle GotFocus and Lost Focus events to golw and un-glow the control.
Problem Left:
No success in selecting multiple controls and dragging them
simultaneously. If i would be able to select multiple controls then
dragging would not be very difficult.
If you are talking about buttons, unfortunately you cant select multiple at a time..
Once I successfully validate user data in a TextBox (using TextChanged EventHandler), I'd like to programmatically tab to the next input control. I know I could hard code the name and do
Score2.Focus(Windows.UI.Xaml.FocusState.Keyboard);
but I've got 20 TextBox controls on the page page and I'd like to use the same EventHandler for all of them.
While it may be possible (iterate through the page's control inspecting their tab order and selecting the appopriate next control), I would recommend against it. It will irritate your user if they leave a text box to go back and correct a previous field but your app decides it knows better and gives focus to another field.
I have a user control that consists of some textboxes and checkboxes. Once the user is finished filling the first one, they should be able to add one more form by clicking an "add another record" link button.
How can I repeat this usercontrol as the user clicks?
I am supposed to use C# only.
So, we are talking of UserControl where your fields are located (I mean, that this is a one class inherited from UserControl or Control. )
There are a lot of ways to do it. But, I think, to be mode 'code concise' is to use FlowLayoutPanel
a) Create this panel. (through visual designer i.e.)
b) When user clicks, create your control
c) add your control to layout panel.
var myControl = new MyControlWithForm();
flowLayoutPanel1.Controls.Add(myControl);
One could use flowLayoutPanel1.Controls array to process all filled forms afterwards.