Ejemplo n.º 1
0
        public Form1()
        {
            dataSet11 = new DataSet1();

            InitializeComponent();
            if (DpiAware.GetCurrentDpi() > 96)
            {
                this.CaptionBarHeight = (int)DpiAware.LogicalToDeviceUnits(this.CaptionBarHeight);
            }

            #region Splitter
            this.ActiveControl             = this.splitterControl1;
            splitterControl1.ThemesEnabled = true;
            #endregion

            #region Grid
            gridControl1.Initialize();
            gridControl1.ThemesEnabled      = true;
            gridControl1.ControllerOptions &= ~(GridControllerOptions.OleDataSource | GridControllerOptions.OleDropTarget);
            gridControl1.CurrentCell.MoveTo(1, 1);
            gridControl1.BaseStylesMap["Header"].StyleInfo.Enabled = false;
            gridControl1.VScrollPixel       = true;
            gridControl1.HScrollPixel       = true;
            this.gridControl1.RowHeights[0] = 30;

            //tab key navigation set as false to move the next control
            this.gridControl1.WantTabKey = false;
            #endregion

            #region Tracer
            tracer = new CurrentCellEventTracer(this.splitterControl1, this.output);
            checkBoxMouseMessage.Checked  = tracer.DisplayMouseMessages;
            checkBoxEnableTracing.Checked = tracer.Enabled;
            #endregion

            #region GridStyleInfo
            GridStyleInfo heading1 = gridControl1.BaseStylesMap["Heading 1"].StyleInfo;
            heading1.TextColor = Color.Blue;
            heading1.Font.Size = 14;
            heading1.Font.Bold = true;

            GridStyleInfo heading2 = gridControl1.BaseStylesMap["Heading 2"].StyleInfo;
            heading2.TextColor = Color.Blue;
            heading2.Font.Size = 14;
            heading2.Font.Bold = true;
            #endregion

            #region PropertyGrid
            this.output.ContextMenu             = this.contextMenu1;
            this.propertyGrid1.CausesValidation = false;
            //this.splitter1.CausesValidation = false;
            this.panel1.CausesValidation = false;
            this.panel2.CausesValidation = false;
            #endregion

            // read the data from a local XML file
            ReadXml(this.dataSet11, @"Data\GDBDdata.XML");
        }
Ejemplo n.º 2
0
        public Form1()
		{
			dataSet11 = new DataSet1();
            eventTracer = new EventTracer();
			InitializeComponent();
            if(DpiAware.GetCurrentDpi() > 96)
            {
                this.CaptionBarHeight = (int)DpiAware.LogicalToDeviceUnits(this.CaptionBarHeight);
            }
            this.LoadEventTracer();
            #region Splitter
            this.ActiveControl = this.splitterControl1;
			splitterControl1.ThemesEnabled = true;
            #endregion

            #region Grid
            gridControl1.Initialize();
			gridControl1.ThemesEnabled = true;
			gridControl1.ControllerOptions &= ~(GridControllerOptions.OleDataSource|GridControllerOptions.OleDropTarget);
			gridControl1.CurrentCell.MoveTo(1, 1);
			gridControl1.BaseStylesMap["Header"].StyleInfo.Enabled = false;
			gridControl1.VScrollPixel = true;
			gridControl1.HScrollPixel = true;
            #endregion

            #region Tracer
            tracer = new CurrentCellEventTracer(this.splitterControl1, this.eventTracer);
			CheckBoxMouseEnable.Checked = tracer.DisplayMouseMessages;
			CheckBoxCurrentCellEnable.Checked = tracer.Enabled;
            #endregion

            #region GridStyleInfo
            GridStyleInfo heading1 = gridControl1.BaseStylesMap["Heading 1"].StyleInfo;
            heading1.TextColor = Color.Blue;//Color.FromArgb( 0xde, 0x64, 0x13 );
            heading1.Font.Facename = "Segoe UI";
			heading1.Font.Size = 12;
			heading1.Font.Bold = false;

			GridStyleInfo heading2 = gridControl1.BaseStylesMap["Heading 2"].StyleInfo;
			heading2.TextColor = Color.Orange;
			heading2.Font.Size = 12;
			heading2.Font.Bold = true;
            #endregion

            #region Trcaer and PropertyGrid
            this.eventTracer.ContextMenu = this.contextMenu1;

			this.propertyGrid1.CausesValidation = false;
			this.panel1.CausesValidation = false;
			this.panel2.CausesValidation = false;

			// read the data from a local XML file
			ReadXml(this.dataSet11, @"Common\Data\GDBDdata.XML");
            #endregion

            this.GridSettings();
        }