Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/280.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何删除FontEditor标题栏_C#_Colors_Font Editor - Fatal编程技术网

C# 如何删除FontEditor标题栏

C# 如何删除FontEditor标题栏,c#,colors,font-editor,C#,Colors,Font Editor,调出ColorEditor需要实现IwinowsFormsEditor服务和IServiceProvider。“颜色”对话框具有很大的灵活性,可以集成到下拉列表中。但FontEditor窗口已经内置了关闭按钮和标题栏。为什么MS在对话框中实现如此不同的东西?如何摆脱关闭按钮和标题栏?调出FontEditor是否必须使用IwinDownFormsEditor服务和IServiceProvider 为什么MS在对话框中实现如此不同的东西 我还没有检查反射的代码。我对它不感兴趣。我 就像抱怨一样 如

调出ColorEditor需要实现IwinowsFormsEditor服务和IServiceProvider。“颜色”对话框具有很大的灵活性,可以集成到下拉列表中。但FontEditor窗口已经内置了关闭按钮和标题栏。为什么MS在对话框中实现如此不同的东西?如何摆脱关闭按钮和标题栏?调出FontEditor是否必须使用IwinDownFormsEditor服务和IServiceProvider

  • 为什么MS在对话框中实现如此不同的东西
  • 我还没有检查反射的代码。我对它不感兴趣。我 就像抱怨一样

  • 如何摆脱关闭按钮和标题栏
  • FontEditor只是一个弹出窗口,我现在不可能这样做

  • 调出FontEditor是否必须使用IwinDownFormsEditor服务和IServiceProvider
  • 我试过了,似乎我们两个都要用,尽管 实际上没有调用IWINDOWSFormsEditor服务

        private void btnFont_Click(object sender, EventArgs e)
        {
            Point location = base.PointToScreen(new Point(btnFont.Bounds.Location.X, btnFont.Bounds.Location.Y + btnFont.Bounds.Height));
            DropDownManager myFontDialog = new DropDownManager(btnFont, new Rectangle(location, new Size(0, 0)), false, false, "Please choose...");                     
            object objectValue = new FontEditor().EditValue(myFontDialog, previousChoosenFont);
            if (objectValue != null)
            {
                previousChoosenFont = (Font)objectValue;
            }
            btnFont.Font = previousChoosenFont;
        }
    
       internal class DropDownManager : IWindowsFormsEditorService, IServiceProvider, IDisposable
        {
           ///......
           void IWindowsFormsEditorService.CloseDropDown()
            {
                throw new NotSupportedException();
            }
    
            void IWindowsFormsEditorService.DropDownControl(Control dropDownControl)
            {            
                throw new NotSupportedException();
            }
    
            DialogResult IWindowsFormsEditorService.ShowDialog(Form dialog)
            {
                throw new NotSupportedException();
            }
    
            object IServiceProvider.GetService(Type serviceType)
            {
                object result = null;
                if (serviceType.Equals(typeof(IWindowsFormsEditorService)))
                {
                    result = this;
                }
                return result;
            }
           ///.....
    }