Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
685
Appointment Dialog - How to hide "Action" tab
posted

Hello,

I need to hide the "Action" tab in the Appointment Dialog (I want to show only the "Description" tab).
Is it possible?

Thank you
MTGC Staff

Parents
No Data
Reply
  • 69832
    Offline posted

    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.

Children