1234567891011121314151617181920212223242526272829303132 |
- using System;
- using System.Drawing;
- using System.Windows.Forms;
- namespace FastReport.Controls
- {
- internal class FRToolStripDropDown : ToolStripDropDown
- {
- private ToolStripControlHost controlHost;
- public FRToolStripDropDown(Control control)
- {
- controlHost = new ToolStripControlHost(control);
- controlHost.AutoSize = false;
- Items.Add(controlHost);
- AutoSize = false;
- control.SizeChanged += Control_SizeChanged;
- Control_SizeChanged(control, EventArgs.Empty);
- }
- private void Control_SizeChanged(object sender, EventArgs e)
- {
- var control = sender as Control;
- controlHost.Size = control.Size;
- #if !(WPF || AVALONIA)
- Size = new Size(control.Size.Width + 2, control.Size.Height + 2);
- control.Location = new Point(1, 1);
- #endif
- }
- }
- }
|