Hello,
I need to hide the "Action" tab in the Appointment Dialog (I want to show only the "Description" tab).Is it possible?
Thank youMTGC Staff
There is no way to modify the stock appointment dialog via the public object model. The AppointmentDialog class, however, is publicly exposed and derives from System.Windows.Forms.Form, so you can use the usual methodology when dealing with forms to modify a control that belongs to it, like so:
private void calendarInfo_BeforeDisplayAppointmentDialog(object sender, DisplayAppointmentDialogEventArgs e){ UltraCalendarInfo calendarInfo = sender as UltraCalendarInfo; e.Cancel = true; AppointmentDialog dialog = new AppointmentDialog( calendarInfo, e.Appointment, e.IsExistingAppointment );
Infragistics.Win.UltraWinTabControl.UltraTabControl tabControl = this.FindTabControl( dialog.Controls );
if ( tabControl != null && tabControl.Tabs.Exists("Action") ) tabControl.Tabs["Action"].Visible = false;
dialog.Show();}
private Infragistics.Win.UltraWinTabControl.UltraTabControl FindTabControl( Control.ControlCollection controls ){ if ( controls == null || controls.Count == 0 ) return null;
foreach ( Control control in controls ) { Infragistics.Win.UltraWinTabControl.UltraTabControl tabControl = control as Infragistics.Win.UltraWinTabControl.UltraTabControl;
if ( tabControl != null ) return tabControl; else { tabControl = this.FindTabControl( control.Controls );
if ( tabControl != null ) return tabControl; } }
return null;}
Please note that changes like this are unsupported, since we reserve the future right to change our default dialog in ways that could potentially break code like this.
Thank you very much, I will try it.