private void InitializeIndexControl( ) { if (Help2ControlsValidation.IsIndexControlRegistered) { try { indexControl = new AxHxIndexCtrl(); indexControl.BeginInit(); this.panIndexControl.Controls.Add(indexControl); indexControl.Parent = panIndexControl; indexControl.Dock = DockStyle.Fill; indexControl.ItemClick += new AxMSHelpControls.IHxIndexViewEvents_ItemClickEventHandler(this.IndexItemClick); indexControl.EndInit(); indexControl.CreateControl(); indexControl.BorderStyle = HxBorderStyle.HxBorderStyle_FixedSingle; indexControl.FontSource = HxFontSourceConstant.HxFontExternal; } catch (System.Runtime.InteropServices.COMException ex) { LoggingService.Error("Help 2.0: Index control failed; " + ex.ToString()); this.indexControlFailed = true; } } this.indexControlFailed = (this.indexControlFailed || indexControl == null); }
private void InitializeComponents() { infoLabel.Dock = DockStyle.Fill; infoLabel.Visible = false; infoLabel.TextAlign = ContentAlignment.MiddleCenter; Controls.Add(infoLabel); if (Help2ControlsValidation.IsIndexControlRegistered) { try { indexControl = new AxHxIndexCtrl(); indexControl.BeginInit(); indexControl.Dock = DockStyle.Fill; indexControl.ItemClick += new AxMSHelpControls.IHxIndexViewEvents_ItemClickEventHandler(this.IndexItemClick); indexControl.EndInit(); Controls.Add(indexControl); indexControl.CreateControl(); indexControl.BorderStyle = HxBorderStyle.HxBorderStyle_FixedSingle; indexControl.FontSource = HxFontSourceConstant.HxFontExternal; } catch (System.Runtime.InteropServices.COMException ex) { LoggingService.Error("Help 2.0: Index control failed; " + ex.ToString()); this.indexControlFailed = true; } } Panel panel1 = new Panel(); Controls.Add(panel1); panel1.Dock = DockStyle.Top; panel1.Height = filterCombobox.Height + 7; panel1.Controls.Add(filterCombobox); filterCombobox.Dock = DockStyle.Top; filterCombobox.DropDownStyle = ComboBoxStyle.DropDownList; filterCombobox.Sorted = true; filterCombobox.Enabled = false; filterCombobox.Font = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); filterCombobox.SelectedIndexChanged += new EventHandler(this.FilterChanged); Controls.Add(label1); label1.Dock = DockStyle.Top; label1.TextAlign = ContentAlignment.MiddleLeft; label1.Font = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); Panel panel2 = new Panel(); Controls.Add(panel2); panel2.Dock = DockStyle.Top; panel2.Height = searchTerm.Height + 7; panel2.Controls.Add(searchTerm); searchTerm.Dock = DockStyle.Top; searchTerm.Enabled = false; searchTerm.Font = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); searchTerm.TextChanged += new EventHandler(this.SearchTextChanged); searchTerm.KeyPress += new KeyPressEventHandler(this.SearchKeyPress); Controls.Add(label2); label2.Dock = DockStyle.Top; label2.TextAlign = ContentAlignment.MiddleLeft; label2.Font = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.RedrawContent(); this.indexControlFailed = (this.indexControlFailed || indexControl == null); }