日期:2014-05-19  浏览次数:20709 次

问题
窗口在RESIZE时   是显示一个虚拟框架  
怎么在程序中显示这样的?

比如用户点了一个BUTTON   然后开始移动   我想显示一个BUTTON的虚影

但是仍然可以看到背景


------解决方案--------------------
up
------解决方案--------------------
Draw吧
------解决方案--------------------
帮LZ顶
------解决方案--------------------
gdi+
------解决方案--------------------
没搞过,up
------解决方案--------------------

------解决方案--------------------
gdi+

先把这个button抓下来,在屏幕上显示
------解决方案--------------------
嘿,有意思..
mark.
------解决方案--------------------
budong
------解决方案--------------------
这个是系统社定,可以在控制面板里面改,忘记具体叫什么属性了
改了后所有窗体都可以这么移动
------解决方案--------------------
而且你看例如QQ的窗体也是这么移动的
------解决方案--------------------
根据鼠标移动,自己画一个`~```
------解决方案--------------------
不会,学习
------解决方案--------------------
非要做的话就要用GDI+自己画了,不过比较麻烦,需要在不断画新的线的同时“擦除”原有的线
------解决方案--------------------
帮接分
------解决方案--------------------
看看个吧
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;

namespace BaseControls
{
/// <summary>
/// splitbar 的摘要说明:用于界面的控件分割条作用。
///Author:XC
///Date:2005-03-18
///使用方法:先在使用的窗口放该控件,然后在属性中的杂项中选择dragtype确定左右拖拽还是上下拖拽,
///在窗体的初始化中调用:该控件的init()和RegControl注册要拖拽的控件
/// </summary>
public class Splitbar : System.Windows.Forms.UserControl
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;

public Splitbar()
{ // 该调用是 Windows.Forms 窗体设计器所必需的。
InitializeComponent();

// TOD 在 InitializeComponent 调用后添加任何初始化

}

/// <summary>
/// 清理所有正在使用的资源。
/// </summary>

protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
} base.Dispose( disposing );
}

#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器
/// 修改此方法的内容。
/// </summary>

private void InitializeComponent()
{
//
// Splitbar
//
this.BackColor = System.Drawing.SystemColors.ControlDark;
this.Cursor = System.Windows.Forms.Cursors.VSplit;
this.Name = "Splitbar "; this.Size = new System.Drawing.Size(24, 162);
this.Click += new System.EventHandler(this.Splitbar_Click);
this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.splitbar_MouseUp);
this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.splitbar_MouseMove);