myPanel.FindForm()
public void GetControlCollection(Control _control, ref List<Control> _controlcollection) { foreach (Control ctrl in _control.Controls) { _controlcollection.Add(ctrl); if (ctrl.Name != "") GetControlCollection(ctrl, ref _controlcollection); } }do not forget add this assembly to project
using Microsoft.Dynamics.Framework.UI.WinForms.Controls;
public static string Control2Name(string name, int id) { byte[] array = TryGuid(name).ToByteArray(); array[6] = Convert.ToByte(id & 255); array[7] = Convert.ToByte(id >> 8 & 255); id >>= 16; if (id > 0) id++; array[4] = Convert.ToByte(id & 255); array[5] = Convert.ToByte(id >> 8 & 255); Guid guid = new Guid(array); return "{" + guid.ToString().ToUpper() + "}"; }
((TextView)_control).TextBox.ForeColor = Color.Red;
private void Page_Disposed(object sender, EventArgs e) { AppDomain CurAppDomain = AppDomain.CurrentDomain; CurAppDomain.SetData(((Form)sender).Name, ElementBuffer); //Where ElementBuffer properties of customized page controls }
Answers
Archerpoint India Pvt. Ltd,Chennai.
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/
What is the add-in?
If you have some experience in creating add-in controls you can make this steps:
1. Create simple control (Panel for example). It can be no visible and need only to get events and form controls on page. Current Form you can get beyond you control like this :
2. Get all controls of form (Page) to List<Control> variables. For example i make function like this do not forget add this assembly to project
3. Create function which find control by ID and set necessary properties. You can do it in Set Value sections if your control inherited from StringControlAddInBase. In Name property of control stored transformated information about Page ID and Control ID.
For transform c\side control ID to Name i use this function where name parameter - it is your control's name (myPanel.Name).
4. So, when you find applicable control in your collection (from point 2.) you can GetType of control and set property that you need.
5. Remember - if control no visible when page open there are no control on form and you can't set property. You must hande ControlAdded event parent of control.
Also you can't to set control's property in OnOpenPage trigger(because there no Form yet), you must create neccesary event.
There are some subtleties in behavior of RTC client. For example when you change settings page controls or page they can be recreated without your changes. To decide this task you need to store your changed controls properties and handle events (Create, Dispose) to store or reestablish property.
Personally, I use this opportunity to store data if page reloaded.
So, good luck!
PS
I said almost everything .