在窗体中使用调整大小点绘制控件选择矩形

时间:2012-10-29 14:09:44

标签: c# .net windows winforms

我想绘制一个带有所选控件的调整大小点的矩形,如下图所示。

enter image description here

我使用了控件的paint事件,我能够为所选控件绘制一个边框矩形。

 Rectangle borderRectangle = new Rectangle(0, 0, this.Width, this.Height);
 ControlPaint.DrawBorder(e.Graphics, borderRectangle, Color.Black,System.Windows.Forms.ButtonBorderStyle.Dotted);

我们是否可以选择在Windows窗体设计器中包含这些功能?

请为我建议一个方法。

先谢谢,

ķ

1 个答案:

答案 0 :(得分:1)

这是一个在codeproject上具有可调整大小控件的自定义实现:

Allow the User to Resize Controls at Runtime

以下是一些关于如何在.NET中构建完整表单设计器的官方信息:

Tailor Your Application by Building a Custom Forms Designer with .NET

相关问题