private void InitializeComponent() { btnAdjust = new System.Windows.Forms.ToolStripButton(); rangeControl = new Microsoft.Tools.ServiceModel.TraceViewer.DTRangeControl(); hostStrip = new System.Windows.Forms.ToolStrip(); SuspendLayout(); btnAdjust.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; btnAdjust.Name = "btnAdjust"; btnAdjust.Size = new System.Drawing.Size(75, 22); btnAdjust.Text = Microsoft.Tools.ServiceModel.TraceViewer.SR.GetString("PL_Adjust"); btnAdjust.Click += new System.EventHandler(btnAdjust_Click); rangeControl.Location = new System.Drawing.Point(16, 2); rangeControl.Name = "rangeControl"; rangeControl.Size = new System.Drawing.Size(680, 20); rangeControl.TabIndex = 2; System.Windows.Forms.ToolStripControlHost toolStripControlHost = new System.Windows.Forms.ToolStripControlHost(rangeControl); hostStrip.Location = new System.Drawing.Point(0, 0); hostStrip.Name = "hostStrip"; hostStrip.Size = new System.Drawing.Size(800, 25); hostStrip.TabIndex = 0; hostStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[2] { toolStripControlHost, btnAdjust }); base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 13f); base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; base.Controls.Add(hostStrip); base.Name = "FilePartialLoadingStrip"; base.Size = new System.Drawing.Size(700, 25); ResumeLayout(performLayout: false); }
//dynamically add an item to the favourites drop down menu given a Favourite public void addFavToMenu(Favourite f) { ContainerControl cc = new ContainerControl(); cc.BackColor = Color.WhiteSmoke; ToolStripControlHost c = new ToolStripControlHost(cc); Button b = new Button(); b.Parent = cc; initRemoveFavButton(b); b.Click += (s, e) => { favMenu.DropDownItems.Remove(c);favs.removeFavourite(f); }; TextBox temp = new TextBox(); temp.Text = f.name; temp.Click += (s, e) => { initNewTab(f.url); }; temp.Parent = cc; temp.Left = b.Size.Width; temp.Left = (int)Math.Floor((float)temp.Left * 1.3f); initFavBox(temp); Button t = new Button(); t.Text = f.url; t.Parent = cc; initMenuButton(t); t.Top = temp.Height>b.Height?temp.Height :b.Height; t.Top = (int)Math.Floor((float)t.Top * 1.1f); t.Left = temp.Left; t.Enabled = false; Button eb = new Button(); eb.Parent = cc; eb.Left = temp.Left + temp.Size.Width; eb.Click += (s, e) => editButtonClick(temp, eb, f); initEditButton(eb); favMenu.DropDownItems.Add(c); }
/// <summary> /// Initializes a new instance of the <see cref="PopupControl.Popup"/> class. /// </summary> /// <param name="content">The content of the pop-up.</param> /// <remarks> /// Pop-up will be disposed immediately after disposion of the content control. /// </remarks> /// <exception cref="T:System.ArgumentNullException"><paramref name="content" /> is <code>null</code>.</exception> public Popup(Control content) { if (content == null) throw new ArgumentNullException("content"); Content = content; FocusOnOpen = true; AcceptAlt = true; ShowingAnimation = PopupAnimations.SystemDefault; HidingAnimation = PopupAnimations.None; AnimationDuration = 100; InitializeComponent(); AutoSize = false; DoubleBuffered = true; ResizeRedraw = true; _host = new ToolStripControlHost(content); Padding = Margin = _host.Padding = _host.Margin = Padding.Empty; if (NativeMethods.IsRunningOnMono) content.Margin = Padding.Empty; MinimumSize = content.MinimumSize; content.MinimumSize = content.Size; MaximumSize = content.MaximumSize; content.MaximumSize = content.Size; Size = content.Size; if (NativeMethods.IsRunningOnMono) _host.Size = content.Size; TabStop = content.TabStop = true; content.Location = Point.Empty; Items.Add(_host); content.Disposed += (sender, e) => { content = null; Dispose(true); }; content.RegionChanged += (sender, e) => UpdateRegion(); content.Paint += (sender, e) => PaintSizeGrip(e); UpdateRegion(); }
/// <summary> /// Constructor /// </summary> public SuggestionDropdownController(Control content) { if (content == null) { throw new ArgumentNullException("content"); } Content = content; Content.Location = Point.Empty; m_host = new ToolStripControlHost(Content); // NB: AutoClose must be set to false, because otherwise the ToolStripManager would steal keyboard events AutoClose = false; // we do ourselves the sizing AutoSize = false; DoubleBuffered = true; ResizeRedraw = false; Padding = Margin = m_host.Padding = m_host.Margin = Padding.Empty; // we adjust the size according to the contents MinimumSize = Content.MinimumSize; content.MinimumSize = Content.Size; MaximumSize = Content.MaximumSize; content.MaximumSize = Content.Size; Size = Content.Size; TabStop = Content.TabStop = true; // set up the content Items.Add(m_host); // we must listen to mouse events for "emulating" AutoClose Application.AddMessageFilter(this); }
/// ------------------------------------------------------------------------------------ /// <summary> /// Initializes a new instance of the <see cref="FwPopup"/> class. /// </summary> /// ------------------------------------------------------------------------------------ public FwPopup() { InitializeComponent(); base.DoubleBuffered = true; if (DesignMode) return; base.Dock = DockStyle.Fill; m_host = new ToolStripControlHost(this); m_host.Padding = Padding.Empty; m_host.Margin = Padding.Empty; m_host.AutoSize = false; m_host.Size = Size; m_host.Dock = DockStyle.Fill; m_owningDropDown = new ToolStripDropDown(); m_owningDropDown.Padding = Padding.Empty; m_owningDropDown.AutoSize = false; m_owningDropDown.LayoutStyle = ToolStripLayoutStyle.Table; m_owningDropDown.Size = Size; m_owningDropDown.Items.Add(m_host); m_owningDropDown.VisibleChanged += m_owningDropDown_VisibleChanged; m_owningDropDown.Opened += m_owningDropDown_Opened; m_owningDropDown.Closed += m_owningDropDown_Closed; m_owningDropDown.Opening += m_owningDropDown_Opening; }
private void FormSagCarinaMission_Load(object sender, EventArgs e) { pickerStart = new DateTimePicker(); pickerStop = new DateTimePicker(); host1 = new ToolStripControlHost(pickerStart); toolStrip1.Items.Add(host1); host2 = new ToolStripControlHost(pickerStop); toolStrip1.Items.Add(host2); pickerStart.Value = DateTime.Today.AddMonths(-1); this.pickerStart.ValueChanged += new System.EventHandler(this.dateTimePickerStart_ValueChanged); this.pickerStop.ValueChanged += new System.EventHandler(this.dateTimePickerStop_ValueChanged); startDate = new DateTime(2010, 1, 1); AddImages(); WindowState = FormWindowState.Maximized; toolStripComboBox1.Items.Clear(); foreach (FGEImage img in fgeimages) { toolStripComboBox1.Items.Add(img.FileName); } toolStripComboBox1.SelectedIndex = 0; toolStripComboBoxTime.SelectedIndex = 0; }
public HexEditContainer() { InitializeComponent(); tbSizeToFit.Text = StringParser.Parse(tbSizeToFit.Text); ToolStripControlHost bytesPerLine = new ToolStripControlHost(tSTBCharsPerLine); this.toolStrip1.Items.Insert(1, bytesPerLine); ToolStripControlHost viewMode = new ToolStripControlHost(tCBViewMode); this.toolStrip1.Items.Insert(3, viewMode); tSTBCharsPerLine.Text = hexEditControl.BytesPerLine.ToString(); this.hexEditControl.ContextMenuStrip = MenuService.CreateContextMenu(this.hexEditControl, "/AddIns/HexEditor/Editor/ContextMenu"); tCBViewMode.SelectedIndex = 0; tSTBCharsPerLine.Value = Settings.BytesPerLine; tCBViewMode.SelectedItem = Settings.ViewMode.ToString(); hexEditControl.ViewMode = Settings.ViewMode; hexEditControl.BytesPerLine = Settings.BytesPerLine; tbSizeToFit.Checked = hexEditControl.FitToWindowWidth = Settings.FitToWidth; tSTBCharsPerLine.Enabled = !Settings.FitToWidth; hexEditControl.Invalidate(); }
public DropDownWindowPopup(ChartControl ownerChart) { Margin = Padding.Empty; Padding = Padding.Empty; AutoSize = false; var window = new SummaryPositionDropWindow(ownerChart.Owner) { Parent = ownerChart }; Width = window.Width; Height = window.Height; window.closeControl += Close; Closing += (sender, args) => { if (window.isPinup) args.Cancel = true; }; var host = new ToolStripControlHost(window) { Margin = Padding.Empty, Padding = Padding.Empty, AutoSize = false }; Items.Add(host); }
public PopupEditorHost(Control control, int left, int top, int width, int height, Func<Control, object> getControlValue, Action<object> onValueUpdated) : this() { this.getControlValue = getControlValue; this.onValueUpdated = onValueUpdated; Content = control; Margin = Padding.Empty; Padding = Padding.Empty; //AutoSize = true; Width = width; Height = height; Left = left; Top = top; Content.Dock = DockStyle.Fill; BindContentHandlers(); var host = new ToolStripControlHost(Content) { Margin = Padding.Empty, Padding = Padding.Empty, AutoSize = false, Width = width, Height = height }; Items.Add(host); Opened += (sender, e) => Content.Focus(); }
public PopupWindow(ColorPopup content) { if (content == null) { throw new ArgumentNullException("content"); } this.content = content; this.AutoSize = false; this.DoubleBuffered = true; this.ResizeRedraw = true; //create a host that will host the content host = new ToolStripControlHost(content); this.Padding = Margin = host.Padding = host.Margin = Padding.Empty; this.MinimumSize = content.MinimumSize; content.MinimumSize = content.Size; MaximumSize = new Size(content.Size.Width + 1, content.Size.Height + 1); content.MaximumSize = new Size(content.Size.Width + 1, content.Size.Height + 1); Size = new Size(content.Size.Width + 1, content.Size.Height + 1); content.Location = Point.Empty; //add the host to the list Items.Add(host); }
void Init(object sender, EventArgs e) { try { hexEditControl.Initializing = true; if (loaded) return; loaded = true; tbSizeToFit.Text = StringParser.Parse(tbSizeToFit.Text); ToolStripControlHost bytesPerLine = new ToolStripControlHost(tSTBCharsPerLine); this.toolStrip1.Items.Insert(1, bytesPerLine); this.toolStrip1.Items.Insert(3, tCBViewMode); hexEditControl.BytesPerLine = Settings.BytesPerLine; tSTBCharsPerLine.Text = hexEditControl.BytesPerLine.ToString(); this.hexEditControl.ContextMenuStrip = MenuService.CreateContextMenu(this.hexEditControl, "/AddIns/HexEditor/Editor/ContextMenu"); tCBViewMode.SelectedIndex = 0; tCBViewMode.SelectedItem = Settings.ViewMode.ToString(); hexEditControl.ViewMode = Settings.ViewMode; tbSizeToFit.Checked = hexEditControl.FitToWindowWidth = Settings.FitToWidth; tSTBCharsPerLine.Enabled = !Settings.FitToWidth; hexEditControl.Invalidate(); } finally { hexEditControl.Initializing = false; } }
public PoperContainer(Control popedControl) { InitializeComponent(); if (popedControl == null) throw new ArgumentNullException("content"); this.m_popedContainer = popedControl; this.m_fade = SystemInformation.IsMenuAnimationEnabled && SystemInformation.IsMenuFadeEnabled; this.m_host = new ToolStripControlHost(popedControl); m_host.AutoSize = false;//make it take the same room as the poped control Padding = Margin = m_host.Padding = m_host.Margin = Padding.Empty; popedControl.Location = Point.Empty; this.Items.Add(m_host); popedControl.Disposed += delegate(object sender, EventArgs e) { popedControl = null; Dispose(true);// this popup container will be disposed immediately after disposion of the contained control }; }
public UndoButton() { // Initialize the custom control m_dropControl = new UndoDropDownControl() { MinimumSize = new Size(SetWidth, SetHeight) // <- important }; m_dropControl.ItemChosen += m_dropControl_ItemChosen; // ...hosted by a ToolStripControlHost m_toolHost = new ToolStripControlHost(m_dropControl) { Size = new Size(SetWidth, SetHeight), Margin = new Padding(0) }; // ... and shown in a ToolStripDropDown. m_toolDrop = new ToolStripDropDown() { Padding = new Padding(0) }; m_toolDrop.Items.Add(m_toolHost); this.DisplayStyle = ToolStripItemDisplayStyle.Image; this.BackgroundImageLayout = ImageLayout.Stretch; // There is no OnDropDownOpening to override, so I guess we have to do it this way. this.DropDownOpening += UndoButton_DropDownOpening; }
public void Constructor () { Control t = new Control (); ToolStripControlHost tsi = new ToolStripControlHost (t); Assert.AreEqual (SystemColors.Control, tsi.BackColor, "A1"); Assert.AreEqual (null, tsi.BackgroundImage, "A2"); Assert.AreEqual (ImageLayout.Tile, tsi.BackgroundImageLayout, "A3"); Assert.AreEqual (true, tsi.CanSelect, "A4"); Assert.AreEqual (true, tsi.CausesValidation, "A5"); Assert.AreSame (t, tsi.Control, "A6"); Assert.AreEqual (ContentAlignment.MiddleCenter, tsi.ControlAlign, "A7"); Assert.AreEqual (true, tsi.Enabled, "A8"); Assert.AreEqual (false, tsi.Focused, "A9"); Assert.AreEqual (t.Font, tsi.Font, "A10"); Assert.AreEqual (SystemColors.ControlText, tsi.ForeColor, "A11"); Assert.AreEqual (RightToLeft.No, tsi.RightToLeft, "A12"); Assert.AreEqual (false, tsi.Selected, "A13"); Assert.AreEqual (null, tsi.Site, "A14"); Assert.AreEqual (new Size (0, 0), tsi.Size, "A15"); Assert.AreEqual (string.Empty, tsi.Text, "A16"); tsi = new ToolStripControlHost (t, "Bob"); Assert.AreEqual ("Bob", tsi.Name, "A17"); Assert.AreSame (t, tsi.Control, "A18"); Assert.AreEqual (string.Empty, tsi.Control.Name, "A19"); }
/// <summary> /// Initializes a new instance of the <see cref="PopupControl.Popup" /> class. /// </summary> /// <param name="content">The content of the pop-up.</param> /// <remarks> /// Pop-up will be disposed immediately after disposion of the content control. /// </remarks> /// <exception cref="T:System.ArgumentNullException"> /// <paramref name="content" /> is <code>null</code>. /// </exception> public Popup(Control content) { if (content == null) { throw new ArgumentNullException("content"); } this.content = content; fade = SystemInformation.IsMenuAnimationEnabled && SystemInformation.IsMenuFadeEnabled; _resizable = true; InitializeComponent(); AutoSize = false; DoubleBuffered = true; ResizeRedraw = true; host = new ToolStripControlHost(content); Padding = Margin = host.Padding = host.Margin = Padding.Empty; MinimumSize = content.MinimumSize; content.MinimumSize = content.Size; MaximumSize = content.MaximumSize; content.MaximumSize = content.Size; Size = content.Size; content.Location = Point.Empty; Items.Add(host); content.Disposed += delegate { content = null; Dispose(true); }; content.RegionChanged += delegate { UpdateRegion(); }; content.Paint += delegate(object sender, PaintEventArgs e) { PaintSizeGrip(e); }; UpdateRegion(); }
private void OnControlChanged(EventArgs e) { if (this.host != null) { this.host.Dispose(); this.host = null; } if (this.control != null) { this.AutoSize = true; // this.host = new ToolStripControlHost(this.control); this.SuspendLayout(); // host // this.host.AutoSize = true; this.host.Margin = new Padding(0); this.host.Padding = new Padding(SystemInformation.Border3DSize.Width); // DateTimePickerPopup this.AutoSize = true; // this.AutoClose = false; base.Items.Add(this.host); this.Padding = Padding.Empty; this.TabStop = false; // Force a rescale?! Removing these lines causes containing control doesnt scale well! // (Is there any better way to do that?) System.Drawing.Font font = this.Font; this.Font = System.Drawing.SystemFonts.DefaultFont; this.Font = font; this.ResumeLayout(true); } }
public void AddControl( IComboBoxExtender child ) { try { childControl = child; childControl.SetUserInterface ( ); treeViewHost = new ToolStripControlHost ( childControl as Control ); treeViewHost.Visible = false; CloseComboBoxExtenderHandler closeCombo = new CloseComboBoxExtenderHandler ( CloseComboBox ); childControl.CloseComboBoxExtenderDelegate = closeCombo; dropDown = new ToolStripDropDown ( ); dropDown.Items.Add ( treeViewHost ); dropDown.AutoClose = true; this.DropDownStyle = ComboBoxStyle.DropDownList; dropDown.Closed += new ToolStripDropDownClosedEventHandler ( DropDownClosed ); this.EnabledChanged += new EventHandler ( ExtenderCombo_EnabledChanged ); closeCombo ( ); } catch ( Exception ex ) { MessageBox.Show ( ex.Message ); } }
public void SetDesignerActionPanel(DesignerActionPanel panel, Glyph relatedGlyph) { if ((this._panel == null) || (panel != ((DesignerActionPanel) this._panel.Control))) { this.relatedGlyph = relatedGlyph; panel.SizeChanged += new EventHandler(this.PanelResized); if (this._panel != null) { this.Items.Remove(this._panel); this._panel.Dispose(); this._panel = null; } this._panel = new ToolStripControlHost(panel); this._panel.Margin = Padding.Empty; this._panel.Size = panel.Size; base.SuspendLayout(); base.Size = panel.Size; this.Items.Add(this._panel); base.ResumeLayout(); if (base.Visible) { this.CheckFocusIsRight(); } } }
/// ------------------------------------------------------------------------------------ /// <summary> /// Encapsulates a color picker drop-down almost just like Word 2003's. /// </summary> /// <param name="fShowUnspecified">if set to <c>true</c> control will include a button /// for the "automatic" choice (i.e., not explicitly specified).</param> /// <param name="selectedColor">Initial color to select.</param> /// ------------------------------------------------------------------------------------ public ColorPickerDropDown(bool fShowUnspecified, Color selectedColor) { LayoutStyle = ToolStripLayoutStyle.VerticalStackWithOverflow; if (fShowUnspecified) { // Add the "Automatic" button. m_autoItem = new ToolStripButton(ColorPickerStrings.kstidUnspecifiedText); m_autoItem.TextAlign = ContentAlignment.MiddleCenter; m_autoItem.Click += new EventHandler(m_autoItem_Click); m_autoItem.Margin = new Padding(1, m_autoItem.Margin.Top, m_autoItem.Margin.Right, m_autoItem.Margin.Bottom); Items.Add(m_autoItem); } // Add all the colored squares. m_colorMatrix = new ColorPickerMatrix(); m_colorMatrix.ColorPicked += new EventHandler(m_colorMatrix_ColorPicked); ToolStripControlHost host = new ToolStripControlHost(m_colorMatrix); host.AutoSize = false; host.Size = new Size(m_colorMatrix.Width + 6, m_colorMatrix.Height + 6); host.Padding = new Padding(3); Items.Add(host); // Add the "More Colors..." button. m_moreItem = new ToolStripMenuItem(ColorPickerStrings.kstidMoreColors); m_moreItem.TextAlign = ContentAlignment.MiddleCenter; m_moreItem.Click += new EventHandler(m_moreItem_Click); Items.Add(m_moreItem); CurrentColor = selectedColor; }
public static ToolStripDropDown NewPopup(Control contents) { var strip = new ToolStripDropDown(); var host = new ToolStripControlHost(contents); strip.Items.Add(host); host.Margin = new Padding(0); return strip; }
/// <summary> /// /// </summary> public TimeManagementToolStrip() { InitializeComponent(); this.Enabled = false; _host = new ToolStripControlHost(trackBarSpeed); this.Items.Add(_host); }
public IntelliSenseWindow() { _listBox = new IntelliSenseBox(this); ToolStripControlHost tch = new ToolStripControlHost(_listBox); this.Items.Add(tch); tch.Padding = Padding.Empty; this.Padding = Padding.Empty; this.ImeMode = ImeMode.Disable; _cancelDelegate = new CancelDelegateT(this.Cancel); }
/** * PLink 초기화 * * */ public virtual void OnLoad() { // 트레이 메뉴에 PLink Remote 추가 ContextMenuStrip menu = getMenuStrip(); if (menu != null) { menu.Items.Insert(0, new ToolStripSeparator()); WebBrowser browser = new WebBrowser(); browser.Navigate("about:blank"); browser.Size = new System.Drawing.Size(400, 250); browser.ScrollBarsEnabled = false; ToolStripControlHost host = new ToolStripControlHost(browser); host.Margin = Padding.Empty; host.Padding = Padding.Empty; host.AutoSize = false; host.DoubleClickEnabled = false; menu.Items.Insert(0, host); menu.VisibleChanged += delegate { if (menu.Visible) { browser.Navigate("http://api.plink/view"); } }; } // PLink HostTab 설정 TabControl.TabPageCollection tabPage = getTabPages(); if (tabPage != null) { TabPage tab = new TabPage(Util.NAME); OnTabStateChange(tab); hostTab.Dock = DockStyle.Fill; tab.Controls.Add(hostTab); tabPage.Add(tab); } // UI 초기화 및 프로그램 초기화 initializeUI(); // UI 설정 로드 hostTab.OnLoad(); // 실행위치 설정 PLink.host.AppName = getAppName(); // 업데이트 체크 System.Version version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; string version_text = version.ToString(); PLink.host.Version = version_text; }
private void CustomToolStripItem_Load(object sender, EventArgs e) { DateTimePicker dt = new DateTimePicker(); dt.Value = DateTime.Now; dt.Format = DateTimePickerFormat.Short; dt.Width /= 2; dt.Font = new Font("Tahoma", dt.Font.Size); item = new ToolStripControlHost(dt); toolStrip1.Items.Insert(1,item); }
public override ToolStripItem CreateEquivalentToolStripItem() { Control control = _createControl(); ToolStripControlHost host = new ToolStripControlHost( control ); host.AutoSize = false; return host; }
public FindBar(ToolStripContainer workspace, EditorControl editor) { this.editor = editor; var cancelImage = Image.FromFile("/res/critical.png".AsAbsolute()); var goImage = Image.FromFile("/res/findnexths.png".AsAbsolute()); workspace.BottomToolStripPanel.Controls.Add(this); Visible = false; Left = workspace.LeftToolStripPanel.Width; Items.Add("", cancelImage, (_, e) => Visible = false); Items.Add(new ToolStripLabel("Find What:")); ec = new FindBarTextBox() { Width = 300 }; ec.Dismissed += () => { Hide(); editor.Focus(); }; ec.Accepted += () => { DoFind(); }; var i = new ToolStripControlHost(ec) { AutoSize = false, Width = ec.Width }; Items.Add(i); Items.Add(new ToolStripButton("", goImage, (_, e) => DoFind())); RegExCheckBox = new CheckBox() { Text = "Regular Expression", AutoSize = false, Width = 130, Checked = false, BackColor = Color.Transparent, }; CaseSensitivityCheckBox = new CheckBox() { Text = "Case Sensitive", Checked = false, BackColor = Color.Transparent, }; var RegExHost = new ToolStripControlHost(RegExCheckBox) { AutoSize = false, Width = RegExCheckBox.Width }; var CaseHost = new ToolStripControlHost(CaseSensitivityCheckBox) { AutoSize = false, Width = CaseSensitivityCheckBox.Width }; Items.Add(RegExHost); Items.Add(CaseHost); }
public FilteringToolStrip(FilterConsumer fc) { this.filterConsumer = fc; fc.SetFilter(lowPass); this.toolStripLabel4 = new System.Windows.Forms.ToolStripLabel(); this.cof = new OnlyNumbersToolStripTextBox(); this.enableFiltering = new CheckBox(); this.enable = new System.Windows.Forms.ToolStripControlHost(this.enableFiltering); // // toolStrip1 // this.toolStrip.Dock = System.Windows.Forms.DockStyle.None; this.toolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.enable, this.toolStripLabel4, this.cof }); this.toolStrip.Location = new System.Drawing.Point(252, 0); this.toolStrip.Name = "toolStrip1"; this.toolStrip.Size = new System.Drawing.Size(197, 25); this.toolStrip.TabIndex = 2; for (int i = 0; ; i++) { string name = lowPass.GetValueName(i); if (name == null) { break; } // // toolStripLabel4 // this.toolStripLabel4.Name = "toolStripLabel4"; this.toolStripLabel4.Size = new System.Drawing.Size(52, 22); this.toolStripLabel4.Text = name; //this.enable.DisplayStyle = ToolStripItemDisplayStyle. this.enableFiltering.CheckedChanged += new System.EventHandler(this.enableFilteringChanged); this.enableFiltering.Checked = false; // cof this.cof.Name = name; this.cof.Size = new System.Drawing.Size(50, 25); this.cof.Text = "100"; this.cof.Tag = i; this.cof.Enabled = this.enableFiltering.Checked; this.cof.textReady += new EventHandler(cof_textReady); } }
public FilteringToolStrip(FilterConsumer fc) { this.filterConsumer = fc; fc.SetFilter(lowPass); this.toolStripLabel4 = new System.Windows.Forms.ToolStripLabel(); this.cof = new OnlyNumbersToolStripTextBox(); this.enableFiltering = new CheckBox(); this.enable = new System.Windows.Forms.ToolStripControlHost(this.enableFiltering); // // toolStrip1 // this.toolStrip.Dock = System.Windows.Forms.DockStyle.None; this.toolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.enable, this.toolStripLabel4, this.cof}); this.toolStrip.Location = new System.Drawing.Point(252, 0); this.toolStrip.Name = "toolStrip1"; this.toolStrip.Size = new System.Drawing.Size(197, 25); this.toolStrip.TabIndex = 2; for (int i = 0; ; i++) { string name = lowPass.GetValueName(i); if (name == null) { break; } // // toolStripLabel4 // this.toolStripLabel4.Name = "toolStripLabel4"; this.toolStripLabel4.Size = new System.Drawing.Size(52, 22); this.toolStripLabel4.Text = name; //this.enable.DisplayStyle = ToolStripItemDisplayStyle. this.enableFiltering.CheckedChanged += new System.EventHandler(this.enableFilteringChanged); this.enableFiltering.Checked = false; // cof this.cof.Name = name; this.cof.Size = new System.Drawing.Size(50, 25); this.cof.Text = "100"; this.cof.Tag = i; this.cof.Enabled = this.enableFiltering.Checked; this.cof.textReady += new EventHandler(cof_textReady); } }
public void Initialize() { this.AutoSize = false; ToolStripControlHost host = new ToolStripControlHost(this.ctl); this.Margin = Padding.Empty; this.Padding = Padding.Empty; host.Margin = Padding.Empty; host.Padding = Padding.Empty; host.AutoSize = false; host.Size = ctl.Size; this.Size = ctl.Size; this.Items.Add(host); }
public Popup(Control content) { Verify.Argument.IsNotNull(content, "content"); _content = content; _popupAnimation = PopupAnimations.SystemDefault; _closeAnimation = PopupAnimations.None; _animationDuration = 100; _isChildPopupOpened = false; AutoSize = false; DoubleBuffered = true; ResizeRedraw = true; _host = new ToolStripControlHost(content) { Padding = Padding.Empty, Margin = Padding.Empty, }; Padding = Padding.Empty; Margin = Padding.Empty; _minimumSize = content.MinimumSize; content.MinimumSize = content.Size; _maximumSize = content.MaximumSize; content.MaximumSize = content.Size; Size = content.Size; content.Location = Point.Empty; content.TabStop = true; TabStop = true; Items.Add(_host); content.Disposed += (sender, e) => { content = null; Dispose(true); }; content.RegionChanged += (sender, e) => { UpdateRegion(); }; content.Paint += (sender, e) => { PaintSizeGrip(e); }; UpdateRegion(); }
public ComboBox_TreeView() { // new empty tree view treeView = new TreeView(); treeView.BorderStyle = BorderStyle.None; treeViewHost = new ToolStripControlHost(treeView); // create drop down and add it dropDown = new ToolStripDropDown(); dropDown.Items.Add(treeViewHost); // adding signal for action after selection treeView.AfterSelect += new TreeViewEventHandler(treeView_AfterSelect); }
public DbComparer() { InitializeComponent(); Connectors = new List<SqlConnector>(); #region Connection Bar (Source) AdBarSource = new AddressBarExt.Controls.AddressBarExt(); this.AdBarSource.BackColor = System.Drawing.Color.White; this.AdBarSource.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; this.AdBarSource.CurrentNode = null; this.AdBarSource.Dock = System.Windows.Forms.DockStyle.Left; this.AdBarSource.Font = new System.Drawing.Font("Calibri", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.AdBarSource.ForeColor = System.Drawing.Color.Navy; this.AdBarSource.Location = new System.Drawing.Point(0, 0); this.AdBarSource.MinimumSize = new System.Drawing.Size(385, 26); this.AdBarSource.Name = "AddressBar"; this.AdBarSource.RootNode = null; this.AdBarSource.SelectedStyle = ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline))); this.AdBarSource.Size = new System.Drawing.Size(482, 31); this.AdBarSource.TabIndex = 2; this.AdBarSource.SelectionChange += new AddressBarExt.Controls.AddressBarExt.SelectionChanged(SourceConnectionChange); ToolStripControlHost Helper = new ToolStripControlHost(AdBarSource); Helper.Width = 350; SourceMenu.Items.Insert(1, Helper); #endregion #region Connection Bar (Destination) AdBarDestination = new AddressBarExt.Controls.AddressBarExt(); this.AdBarDestination.BackColor = System.Drawing.Color.White; this.AdBarDestination.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; this.AdBarDestination.CurrentNode = null; this.AdBarDestination.Dock = System.Windows.Forms.DockStyle.Left; this.AdBarDestination.Font = new System.Drawing.Font("Calibri", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.AdBarDestination.ForeColor = System.Drawing.Color.Navy; this.AdBarDestination.Location = new System.Drawing.Point(0, 0); this.AdBarDestination.MinimumSize = new System.Drawing.Size(385, 26); this.AdBarDestination.Name = "AddressBar"; this.AdBarDestination.RootNode = null; this.AdBarDestination.SelectedStyle = ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline))); this.AdBarDestination.Size = new System.Drawing.Size(482, 31); this.AdBarDestination.TabIndex = 2; this.AdBarDestination.SelectionChange += new AddressBarExt.Controls.AddressBarExt.SelectionChanged(DestinationConnectionChange); ToolStripControlHost Helper1 = new ToolStripControlHost(AdBarDestination); Helper1.Width = 350; DestinationMenu.Items.Insert(1, Helper1); #endregion }
private void CreateHost(Control control) { if (control == null) { throw new ArgumentException("control"); } _popupControl = control; _controlHost = new ToolStripControlHost(control, "popupControlHost"); _controlHost.AutoSize = false; _controlHost.Padding = Padding.Empty; _controlHost.Margin = Padding.Empty; base.Size = new Size(//120, 120); control.Width + Padding.Horizontal, control.Height + Padding.Vertical); base.Items.Add(_controlHost); }
public void Show(Point screenLocation) { ToolStripControlHost host = new ToolStripControlHost(this); ToolStripDropDown = new ToolStripDropDown(); ToolStripDropDown.Items.Clear(); ToolStripDropDown.Items.Add(host); ToolStripDropDown.Padding = Padding.Empty; ToolStripDropDown.Margin = Padding.Empty; host.Padding = Padding.Empty; host.Margin = Padding.Empty; ToolStripDropDown.Closed += new ToolStripDropDownClosedEventHandler(ToolStripDropDown_Closed); ToolStripDropDown.Show(screenLocation); }
public PopupWindow(System.Windows.Forms.Control content) { //Basic setup... this.AutoSize = false; this.DoubleBuffered = true; this.ResizeRedraw = true; this._content = content; this._host = new System.Windows.Forms.ToolStripControlHost(content); //Positioning and Sizing this.MinimumSize = content.MinimumSize; this.MaximumSize = content.Size; this.Size = content.Size; content.Location = Point.Empty; //Add the host to the list this.Items.Add(this._host); }
public Popup(Control content) { var tmp = this; if (content == null) { throw new ArgumentNullException("content"); } this.content = content; this.fade = (SystemInformation.IsMenuAnimationEnabled && SystemInformation.IsMenuFadeEnabled); this._resizable = true; this.InitializeComponent(); this.AutoSize = false; this.DoubleBuffered = true; base.ResizeRedraw = true; this.host = new ToolStripControlHost(content); base.Padding = (base.Margin = (this.host.Padding = (this.host.Margin = Padding.Empty))); this.MinimumSize = content.MinimumSize; content.MinimumSize = content.Size; this.MaximumSize = content.MaximumSize; content.MaximumSize = content.Size; base.Size = content.Size; content.Location = Point.Empty; this.Items.Add(this.host); content.Disposed += delegate(object sender, EventArgs e) { content = null; tmp.Dispose(true); } ; content.RegionChanged += delegate(object sender, EventArgs e) { this.UpdateRegion(); } ; content.Paint += delegate(object sender, PaintEventArgs e) { this.PaintSizeGrip(e); } ; this.UpdateRegion(); }
private void WireUpTextBox(ref ToolStripItem oldTextBox, ToolStripItem newTextBox, KeyEventHandler keyUpHandler, EventHandler lostFocusHandler) { if (oldTextBox != newTextBox) { ToolStripControlHost host = oldTextBox as ToolStripControlHost; ToolStripControlHost host2 = newTextBox as ToolStripControlHost; if (host != null) { host.KeyUp -= keyUpHandler; host.LostFocus -= lostFocusHandler; } if (host2 != null) { host2.KeyUp += keyUpHandler; host2.LostFocus += lostFocusHandler; } oldTextBox = newTextBox; this.RefreshItemsInternal(); } }
public PopupWindow(System.Windows.Forms.Control content, Padding padding) { AutoSize = false; AutoClose = false; DoubleBuffered = true; ResizeRedraw = true; Padding = padding; System.Drawing.Size contentSize = new System.Drawing.Size( content.Size.Width + padding.Horizontal, content.Size.Height + padding.Vertical); System.Drawing.Size contentMinimumSize = new System.Drawing.Size( content.MinimumSize.Width + padding.Horizontal, content.MinimumSize.Height + padding.Vertical); MinimumSize = contentMinimumSize; MaximumSize = contentSize; Size = contentSize; ToolStripControlHost host = new System.Windows.Forms.ToolStripControlHost(content); Items.Add(host); }
/// <summary> /// Shows this Popup on the specified location of the screen /// </summary> /// <param name="screenLocation"></param> public void Show(Point screenLocation) { ToolStripControlHost host = new ToolStripControlHost(this); WrappedDropDown = new RibbonWrappedDropDown(); WrappedDropDown.AutoClose = RibbonDesigner.Current != null; WrappedDropDown.Items.Add(host); WrappedDropDown.Padding = Padding.Empty; WrappedDropDown.Margin = Padding.Empty; host.Padding = Padding.Empty; host.Margin = Padding.Empty; WrappedDropDown.Opening += new CancelEventHandler(ToolStripDropDown_Opening); WrappedDropDown.Closing += new ToolStripDropDownClosingEventHandler(ToolStripDropDown_Closing); WrappedDropDown.Closed += new ToolStripDropDownClosedEventHandler(ToolStripDropDown_Closed); WrappedDropDown.Size = Size; WrappedDropDown.Show(screenLocation); RibbonPopupManager.Register(this); OnShowed(EventArgs.Empty); }
public Popup(Control content) { if (content == null) { throw new ArgumentNullException("content"); } this.content = content; this.fade = SystemInformation.IsMenuAnimationEnabled && SystemInformation.IsMenuFadeEnabled; this._resizable = true; InitializeComponent(); AutoSize = false; DoubleBuffered = true; ResizeRedraw = true; host = new ToolStripControlHost(content); Padding = Margin = host.Padding = host.Margin = Padding.Empty; MinimumSize = content.MinimumSize; content.MinimumSize = content.Size; MaximumSize = content.MaximumSize; content.MaximumSize = content.Size; Size = content.Size; content.Location = Point.Empty; Items.Add(host); this.BackColor = TX.Framework.WindowUI.SkinManager.CurrentSkin.ThemeColor; content.Disposed += delegate(object sender, EventArgs e) { content = null; Dispose(true); }; content.RegionChanged += delegate(object sender, EventArgs e) { UpdateRegion(); }; content.Paint += delegate(object sender, PaintEventArgs e) { PaintSizeGrip(e); }; UpdateRegion(); }
public ImageDropDownPortion(System.Windows.Forms.Control content, Size minimumSize) { //Basic setup... this.AutoSize = false; this.DoubleBuffered = true; this.ResizeRedraw = true; this._content = content; this._host = new System.Windows.Forms.ToolStripControlHost(content); content.Location = new Point(8, 0); content.Size = new Size(Width, Height - 3); AutoSize = false; DoubleBuffered = true; ResizeRedraw = true; //Positioning and Sizing this.MinimumSize = minimumSize; //this.MaximumSize = content.Size; //this.Size = content.Size; content.Location = Point.Empty; this.Margin = Padding.Empty; Padding = Margin = _host.Padding = _host.Margin = Padding.Empty; //Add the host to the list) this.Items.Add(this._host); content.Disposed += (sender, e) => { content = null; Dispose(true); }; //content.RegionChanged += (sender, e) => UpdateRegion(); //UpdateRegion(); }
/// <devdoc> /// Wire up some member variable to the specified text box item, hooking events /// on the new text box and unhooking them from the previous text box, if required. /// </devdoc> private void WireUpTextBox(ref ToolStripItem oldTextBox, ToolStripItem newTextBox, KeyEventHandler keyUpHandler, EventHandler lostFocusHandler) { if (oldTextBox != newTextBox) { ToolStripControlHost oldCtrl = oldTextBox as ToolStripControlHost; ToolStripControlHost newCtrl = newTextBox as ToolStripControlHost; if (oldCtrl != null) { oldCtrl.KeyUp -= keyUpHandler; oldCtrl.LostFocus -= lostFocusHandler; } if (newCtrl != null) { newCtrl.KeyUp += keyUpHandler; newCtrl.LostFocus += lostFocusHandler; } oldTextBox = newTextBox; RefreshItemsInternal(); } }
/// <summary> /// Returns an observable sequence wrapping the KeyPress event on the ToolStripControlHost instance. /// </summary> /// <param name="instance">The ToolStripControlHost instance to observe.</param> /// <returns>An observable sequence wrapping the KeyPress event on the ToolStripControlHost instance.</returns> public static IObservable <EventPattern <KeyPressEventArgs> > KeyPressObservable(this ToolStripControlHost instance) { return(Observable.FromEventPattern <KeyPressEventHandler, KeyPressEventArgs>( handler => instance.KeyPress += handler, handler => instance.KeyPress -= handler)); }
/// <summary> /// Returns an observable sequence wrapping the LostFocus event on the ToolStripControlHost instance. /// </summary> /// <param name="instance">The ToolStripControlHost instance to observe.</param> /// <returns>An observable sequence wrapping the LostFocus event on the ToolStripControlHost instance.</returns> public static IObservable <EventPattern <EventArgs> > LostFocusObservable(this ToolStripControlHost instance) { return(Observable.FromEventPattern <EventHandler, EventArgs>( handler => instance.LostFocus += handler, handler => instance.LostFocus -= handler)); }
/// <summary> /// Returns an observable sequence wrapping the DisplayStyleChanged event on the ToolStripControlHost instance. /// </summary> /// <param name="instance">The ToolStripControlHost instance to observe.</param> /// <returns>An observable sequence wrapping the DisplayStyleChanged event on the ToolStripControlHost instance.</returns> public static IObservable <EventPattern <EventArgs> > DisplayStyleChangedObservable(this ToolStripControlHost instance) { return(Observable.FromEventPattern <EventHandler, EventArgs>( handler => instance.DisplayStyleChanged += handler, handler => instance.DisplayStyleChanged -= handler)); }
/// <summary> /// Returns an observable sequence wrapping the Validating event on the ToolStripControlHost instance. /// </summary> /// <param name="instance">The ToolStripControlHost instance to observe.</param> /// <returns>An observable sequence wrapping the Validating event on the ToolStripControlHost instance.</returns> public static IObservable <EventPattern <CancelEventArgs> > ValidatingObservable(this ToolStripControlHost instance) { return(Observable.FromEventPattern <CancelEventHandler, CancelEventArgs>( handler => instance.Validating += handler, handler => instance.Validating -= handler)); }
/// <summary> /// Creates the new instance of ToolStripHostedControlAccessibleObject. /// </summary> /// <param name="toolStripHostedControl">The ToolStrip control hosted in the ToolStripControlHost container.</param> /// <param name="toolStripControlHost">The ToolStripControlHost container which hosts the control.</param> public ToolStripHostedControlAccessibleObject(Control toolStripHostedControl, ToolStripControlHost toolStripControlHost) : base(toolStripHostedControl) { _toolStripControlHost = toolStripControlHost; _toolStripHostedControl = toolStripHostedControl; }
public ToolStripControlHostAccessibleObject(ToolStripControlHost ownerItem) : base(ownerItem) { _ownerItem = ownerItem; }
public ToolStripNumericUpDownAccessibleObject(Control toolStripHostedControl, ToolStripControlHost toolStripControlHost) : base(toolStripHostedControl, toolStripControlHost) { }
private void InitForm() { ComponentResourceManager manager = new ComponentResourceManager(typeof(PrintPreviewDialog)); this.toolStrip1 = new ToolStrip(); this.printToolStripButton = new ToolStripButton(); this.zoomToolStripSplitButton = new ToolStripSplitButton(); this.autoToolStripMenuItem = new ToolStripMenuItem(); this.toolStripMenuItem1 = new ToolStripMenuItem(); this.toolStripMenuItem2 = new ToolStripMenuItem(); this.toolStripMenuItem3 = new ToolStripMenuItem(); this.toolStripMenuItem4 = new ToolStripMenuItem(); this.toolStripMenuItem5 = new ToolStripMenuItem(); this.toolStripMenuItem6 = new ToolStripMenuItem(); this.toolStripMenuItem7 = new ToolStripMenuItem(); this.toolStripMenuItem8 = new ToolStripMenuItem(); this.separatorToolStripSeparator = new ToolStripSeparator(); this.onepageToolStripButton = new ToolStripButton(); this.twopagesToolStripButton = new ToolStripButton(); this.threepagesToolStripButton = new ToolStripButton(); this.fourpagesToolStripButton = new ToolStripButton(); this.sixpagesToolStripButton = new ToolStripButton(); this.separatorToolStripSeparator1 = new ToolStripSeparator(); this.closeToolStripButton = new ToolStripButton(); this.pageCounter = new NumericUpDown(); this.pageToolStripLabel = new ToolStripLabel(); this.toolStrip1.SuspendLayout(); this.pageCounter.BeginInit(); base.SuspendLayout(); manager.ApplyResources(this.toolStrip1, "toolStrip1"); this.toolStrip1.Items.AddRange(new ToolStripItem[] { this.printToolStripButton, this.zoomToolStripSplitButton, this.separatorToolStripSeparator, this.onepageToolStripButton, this.twopagesToolStripButton, this.threepagesToolStripButton, this.fourpagesToolStripButton, this.sixpagesToolStripButton, this.separatorToolStripSeparator1, this.closeToolStripButton }); this.toolStrip1.Name = "toolStrip1"; this.toolStrip1.RenderMode = ToolStripRenderMode.System; this.toolStrip1.GripStyle = ToolStripGripStyle.Hidden; this.printToolStripButton.DisplayStyle = ToolStripItemDisplayStyle.Image; this.printToolStripButton.Name = "printToolStripButton"; manager.ApplyResources(this.printToolStripButton, "printToolStripButton"); this.zoomToolStripSplitButton.DisplayStyle = ToolStripItemDisplayStyle.Image; this.zoomToolStripSplitButton.DoubleClickEnabled = true; this.zoomToolStripSplitButton.DropDownItems.AddRange(new ToolStripItem[] { this.autoToolStripMenuItem, this.toolStripMenuItem1, this.toolStripMenuItem2, this.toolStripMenuItem3, this.toolStripMenuItem4, this.toolStripMenuItem5, this.toolStripMenuItem6, this.toolStripMenuItem7, this.toolStripMenuItem8 }); this.zoomToolStripSplitButton.Name = "zoomToolStripSplitButton"; this.zoomToolStripSplitButton.SplitterWidth = 1; manager.ApplyResources(this.zoomToolStripSplitButton, "zoomToolStripSplitButton"); this.autoToolStripMenuItem.CheckOnClick = true; this.autoToolStripMenuItem.DoubleClickEnabled = true; this.autoToolStripMenuItem.Checked = true; this.autoToolStripMenuItem.Name = "autoToolStripMenuItem"; manager.ApplyResources(this.autoToolStripMenuItem, "autoToolStripMenuItem"); this.toolStripMenuItem1.CheckOnClick = true; this.toolStripMenuItem1.DoubleClickEnabled = true; this.toolStripMenuItem1.Name = "toolStripMenuItem1"; manager.ApplyResources(this.toolStripMenuItem1, "toolStripMenuItem1"); this.toolStripMenuItem2.CheckOnClick = true; this.toolStripMenuItem2.DoubleClickEnabled = true; this.toolStripMenuItem2.Name = "toolStripMenuItem2"; manager.ApplyResources(this.toolStripMenuItem2, "toolStripMenuItem2"); this.toolStripMenuItem3.CheckOnClick = true; this.toolStripMenuItem3.DoubleClickEnabled = true; this.toolStripMenuItem3.Name = "toolStripMenuItem3"; manager.ApplyResources(this.toolStripMenuItem3, "toolStripMenuItem3"); this.toolStripMenuItem4.CheckOnClick = true; this.toolStripMenuItem4.DoubleClickEnabled = true; this.toolStripMenuItem4.Name = "toolStripMenuItem4"; manager.ApplyResources(this.toolStripMenuItem4, "toolStripMenuItem4"); this.toolStripMenuItem5.CheckOnClick = true; this.toolStripMenuItem5.DoubleClickEnabled = true; this.toolStripMenuItem5.Name = "toolStripMenuItem5"; manager.ApplyResources(this.toolStripMenuItem5, "toolStripMenuItem5"); this.toolStripMenuItem6.CheckOnClick = true; this.toolStripMenuItem6.DoubleClickEnabled = true; this.toolStripMenuItem6.Name = "toolStripMenuItem6"; manager.ApplyResources(this.toolStripMenuItem6, "toolStripMenuItem6"); this.toolStripMenuItem7.CheckOnClick = true; this.toolStripMenuItem7.DoubleClickEnabled = true; this.toolStripMenuItem7.Name = "toolStripMenuItem7"; manager.ApplyResources(this.toolStripMenuItem7, "toolStripMenuItem7"); this.toolStripMenuItem8.CheckOnClick = true; this.toolStripMenuItem8.DoubleClickEnabled = true; this.toolStripMenuItem8.Name = "toolStripMenuItem8"; manager.ApplyResources(this.toolStripMenuItem8, "toolStripMenuItem8"); this.separatorToolStripSeparator.Name = "separatorToolStripSeparator"; this.onepageToolStripButton.DisplayStyle = ToolStripItemDisplayStyle.Image; this.onepageToolStripButton.Name = "onepageToolStripButton"; manager.ApplyResources(this.onepageToolStripButton, "onepageToolStripButton"); this.twopagesToolStripButton.DisplayStyle = ToolStripItemDisplayStyle.Image; this.twopagesToolStripButton.Name = "twopagesToolStripButton"; manager.ApplyResources(this.twopagesToolStripButton, "twopagesToolStripButton"); this.threepagesToolStripButton.DisplayStyle = ToolStripItemDisplayStyle.Image; this.threepagesToolStripButton.Name = "threepagesToolStripButton"; manager.ApplyResources(this.threepagesToolStripButton, "threepagesToolStripButton"); this.fourpagesToolStripButton.DisplayStyle = ToolStripItemDisplayStyle.Image; this.fourpagesToolStripButton.Name = "fourpagesToolStripButton"; manager.ApplyResources(this.fourpagesToolStripButton, "fourpagesToolStripButton"); this.sixpagesToolStripButton.DisplayStyle = ToolStripItemDisplayStyle.Image; this.sixpagesToolStripButton.Name = "sixpagesToolStripButton"; manager.ApplyResources(this.sixpagesToolStripButton, "sixpagesToolStripButton"); this.separatorToolStripSeparator1.Name = "separatorToolStripSeparator1"; this.closeToolStripButton.DisplayStyle = ToolStripItemDisplayStyle.Text; this.closeToolStripButton.Name = "closeToolStripButton"; manager.ApplyResources(this.closeToolStripButton, "closeToolStripButton"); manager.ApplyResources(this.pageCounter, "pageCounter"); this.pageCounter.Text = "1"; this.pageCounter.TextAlign = HorizontalAlignment.Right; this.pageCounter.DecimalPlaces = 0; this.pageCounter.Minimum = 0M; this.pageCounter.Maximum = 1000M; this.pageCounter.ValueChanged += new EventHandler(this.UpdownMove); this.pageCounter.Name = "pageCounter"; this.pageToolStripLabel.Alignment = ToolStripItemAlignment.Right; this.pageToolStripLabel.Name = "pageToolStripLabel"; manager.ApplyResources(this.pageToolStripLabel, "pageToolStripLabel"); this.previewControl.Size = new System.Drawing.Size(0x318, 610); this.previewControl.Location = new Point(0, 0x2b); this.previewControl.Dock = DockStyle.Fill; this.previewControl.StartPageChanged += new EventHandler(this.previewControl_StartPageChanged); this.printToolStripButton.Click += new EventHandler(this.OnprintToolStripButtonClick); this.autoToolStripMenuItem.Click += new EventHandler(this.ZoomAuto); this.toolStripMenuItem1.Click += new EventHandler(this.Zoom500); this.toolStripMenuItem2.Click += new EventHandler(this.Zoom250); this.toolStripMenuItem3.Click += new EventHandler(this.Zoom150); this.toolStripMenuItem4.Click += new EventHandler(this.Zoom100); this.toolStripMenuItem5.Click += new EventHandler(this.Zoom75); this.toolStripMenuItem6.Click += new EventHandler(this.Zoom50); this.toolStripMenuItem7.Click += new EventHandler(this.Zoom25); this.toolStripMenuItem8.Click += new EventHandler(this.Zoom10); this.onepageToolStripButton.Click += new EventHandler(this.OnonepageToolStripButtonClick); this.twopagesToolStripButton.Click += new EventHandler(this.OntwopagesToolStripButtonClick); this.threepagesToolStripButton.Click += new EventHandler(this.OnthreepagesToolStripButtonClick); this.fourpagesToolStripButton.Click += new EventHandler(this.OnfourpagesToolStripButtonClick); this.sixpagesToolStripButton.Click += new EventHandler(this.OnsixpagesToolStripButtonClick); this.closeToolStripButton.Click += new EventHandler(this.OncloseToolStripButtonClick); this.closeToolStripButton.Paint += new PaintEventHandler(this.OncloseToolStripButtonPaint); this.toolStrip1.ImageList = this.imageList; this.printToolStripButton.ImageIndex = 0; this.zoomToolStripSplitButton.ImageIndex = 1; this.onepageToolStripButton.ImageIndex = 2; this.twopagesToolStripButton.ImageIndex = 3; this.threepagesToolStripButton.ImageIndex = 4; this.fourpagesToolStripButton.ImageIndex = 5; this.sixpagesToolStripButton.ImageIndex = 6; this.previewControl.TabIndex = 0; this.toolStrip1.TabIndex = 1; this.zoomToolStripSplitButton.DefaultItem = this.autoToolStripMenuItem; ToolStripDropDownMenu dropDown = this.zoomToolStripSplitButton.DropDown as ToolStripDropDownMenu; if (dropDown != null) { dropDown.ShowCheckMargin = true; dropDown.ShowImageMargin = false; dropDown.RenderMode = ToolStripRenderMode.System; } ToolStripControlHost host = new ToolStripControlHost(this.pageCounter) { Alignment = ToolStripItemAlignment.Right }; this.toolStrip1.Items.Add(host); this.toolStrip1.Items.Add(this.pageToolStripLabel); manager.ApplyResources(this, "$this"); base.Controls.Add(this.previewControl); base.Controls.Add(this.toolStrip1); base.ClientSize = new System.Drawing.Size(400, 300); this.MinimizeBox = false; this.ShowInTaskbar = false; this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; this.toolStrip1.ResumeLayout(false); this.pageCounter.EndInit(); base.ResumeLayout(false); base.PerformLayout(); }