示例#1
0
        public void ux_tabcontrolShowProperties(TabControl ux_tabcontrolDataview, int indexOfCurrentTab)
        {
            DataviewProperties dvp;
            if (ux_tabcontrolDataview.SelectedTab != null &&
                ux_tabcontrolDataview.SelectedTab.Tag != null &&
                ux_tabcontrolDataview.SelectedTab.Tag.GetType() == typeof(DataviewProperties) &&
                !string.IsNullOrEmpty(((DataviewProperties)ux_tabcontrolDataview.SelectedTab.Tag).TabName))
            {
                dvp = (DataviewProperties)ux_tabcontrolDataview.SelectedTab.Tag;
            }
            else
            {
                dvp = new DataviewProperties();
                dvp.TabName = ux_tabcontrolDataview.SelectedTab.Text;
                dvp.DataviewName = (string)ux_tabcontrolDataview.SelectedTab.Tag;
                dvp.StrongFormName = "";
                dvp.ViewerStyle = "Spreadsheet";
                dvp.AlwaysOnTop = "false";
            }

            DataviewTabProperties dataviewTabPropertiesDialog = new DataviewTabProperties(_webServices, dvp);
            dataviewTabPropertiesDialog.StartPosition = FormStartPosition.CenterParent;
            if (dataviewTabPropertiesDialog.ShowDialog() == DialogResult.OK)
            {
                ux_tabcontrolDataview.TabPages[indexOfCurrentTab].Tag = dataviewTabPropertiesDialog.TabProperties;
                ux_tabcontrolDataview.TabPages[indexOfCurrentTab].Text = ((DataviewProperties)ux_tabcontrolDataview.TabPages[indexOfCurrentTab].Tag).TabName;
            }
        }
示例#2
0
        public void ux_tabcontrolCreateNewTab(TabControl ux_tabcontrolDataview, int indexOfNewTab)
        {
            DataviewProperties dvp = new DataviewProperties();
            dvp.TabName = "";
            dvp.DataviewName = "";
            dvp.StrongFormName = "";
            dvp.ViewerStyle = "Spreadsheet";
            dvp.AlwaysOnTop = "false";

            DataviewTabProperties newTabDialog = new DataviewTabProperties(_webServices, dvp);
            newTabDialog.StartPosition = FormStartPosition.CenterParent;
            if (newTabDialog.ShowDialog() == DialogResult.OK)
            {
                ux_tabcontrolAddTab(ux_tabcontrolDataview, newTabDialog.TabProperties.TabName, newTabDialog.TabProperties, indexOfNewTab);
                ux_tabcontrolDataview.SelectedIndex = indexOfNewTab;
                //SetDGVMainDataviewUserSettings();
            }
            else
            {
                ux_tabcontrolDataview.DeselectTab(indexOfNewTab);
            }
        }