就像Word 2007里的“保存”按钮一样,它是放在标题栏里的。就是Form的最小化,最大化和关闭按钮的位置。或者像TheWorld世界之窗浏览器一样,把菜单放在标题栏里。这样可以节省一行的空间。 可是我的为什么不行。我用的是Visual Studio 2005。按钮和菜单放不上去。 有什么好办法吗? 谢谢!
解决方案 »
- framework2.0 能在没有打任何补丁的XP原版上运行吗?
- 获取GridView动态模板中TextBox控件的ID
- 我用regasm.exe将dll文件注册进com+后,交给vb6调用,怎么才能知道dll内部的异常?
- TreeNode的Checked问题
- 如何从服务器中读取数据库的名字,以及再从数据库中读取表的名字
- datatable 与 datagrid 急!!
- C#设置全局钩子后按键会执行两次,何解?
- 求日志挖掘源码一份,重金相谢
- 如何配置IIS6,让他能够下载源文件
- 求SQL语句构造,关于数据库中的重复数据的
- 關於自動生成訂單號
- vs2005如何设置才能在保存文件时自动编译该文件所属的的项目?
//using System.Runtime.InteropServices;
//using System.Drawing.Drawing2D;[DllImport("user32.dll")]
private static extern IntPtr GetWindowDC(IntPtr hWnd);
[DllImport("user32.dll")]
private static extern int ReleaseDC(IntPtr hWnd, IntPtr hDC);private const int WM_NCPAINT = 0x0085;
private const int WM_NCACTIVATE = 0x0086;
private const int WM_NCLBUTTONDOWN = 0x00A1;
protected override void WndProc(ref Message m)
{
base.WndProc(ref m);
Rectangle vRectangle = new Rectangle((Width - 75) / 2, 3, 75, 25);
switch (m.Msg)
{
case WM_NCPAINT:
case WM_NCACTIVATE:
IntPtr vHandle = GetWindowDC(m.HWnd);
Graphics vGraphics = Graphics.FromHdc(vHandle);
vGraphics.FillRectangle(new LinearGradientBrush(vRectangle,
Color.Pink, Color.Purple, LinearGradientMode.BackwardDiagonal),
vRectangle);
StringFormat vStringFormat = new StringFormat();
vStringFormat.Alignment = StringAlignment.Center;
vStringFormat.LineAlignment = StringAlignment.Center;
vGraphics.DrawString("About", Font, Brushes.BlanchedAlmond,
vRectangle, vStringFormat); vGraphics.Dispose();
ReleaseDC(m.HWnd, vHandle);
break;
case WM_NCLBUTTONDOWN:
Point vPoint = new Point((int)m.LParam);
vPoint.Offset(-Left, -Top);
if (vRectangle.Contains(vPoint))
MessageBox.Show(vPoint.ToString());
break;
}
}