C#窗口效果................................. [英] C# Window Effect....................................

查看:87
本文介绍了C#窗口效果.................................的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在MS Office 2010和2007中,它们在顶部的窗口部分中具有按钮和关闭最小化按钮所在的位置.

如何在窗口区域中放置按钮和东西?

我相信他们可以在带有标签的Google chrome中执行此操作.

有人可以帮我吗.

In MS office 2010 and 2007 they have buttons and things in the top window part where the close minimize buttons are.

How do i put buttons and things in the window area?

I believe they do this in Google chrome with the tabs.

Can anyone please help me out.

推荐答案

我只是看着Word 2007,标题栏的右边没有任何东西,但左上方角落的标题栏中包含应用程序球体和一些图标.那是你在说什么吗?如果是这样,那就是功能区栏的一部分,您可以在同意免费许可条款后从Microsoft下载该代码.
I just looked at Word 2007, and there''s nothing on the right side of the titlebar, but the top-left corner has the app orb and some icons in the titlebar. Is that what you''re talking about? If so, that''s part of the ribbon bar, and you can downbload the code for that from Microsoft after you agree to the free license terms.


Google是您的朋友:很好经常拜访他与在这里发布问题相比,他可以更快地回答问题.
http://www.dotnet247.com/247reference/msgs/41/207281.aspx [ ^ ]
Google is your friend: Be nice and visit him often. He can answer questions a lot more quickly than posting them here...
http://www.dotnet247.com/247reference/msgs/41/207281.aspx[^]


首先将FormBorderStyle设置为none,将面板添加到Form并将面板停靠样式设置为Dockstyle.Top.现在,在第一个面板中添加3个面板,并将所需的图像设置为面板背景图像.当表格边界消失时,移动表格的能力也就消失了.要解决此问题,请在代码中添加一个mousedown,mouseup和mousemove事件,以及一个私有bool CanMove和private Point currentPosition的bool值.
现在我们已经到位了,使用这些代码.

First Set the FormBorderStyle to none, Add a panel to the Form and set the panels dock style to Dockstyle.Top. Now add 3 Panels to the first Panel and set the desired image to the panels background image. When the forms border is Gone So is the ability to move the form. To fix this add a mousedown, mouseup, and mousemove Events to your code and also a bool value of private bool CanMove and private Point currentPosition.
Now that we have this in place use these codes.

using System.Drawing;

private bool CanMove;
private Point currentPosition;

private void panel1_MouseDown(object sender, EventArgs e)
{
   CanMove = true;
   currentPosition.X = e.X;
   currentPosition.Y = e.Y;
}

private void panel1_MouseUp(object sender, EventArgs e)
{
    CanMove = false;
}

private void panel1_MouseMove(object sender, EventArgs e)
{
 if (CanMove)
{
    Point newPosition = Control.MousePosition;
     newPosition.X = newPosition.X - currentPosition.X;
     newPosition.Y = newPosition.Y - currentPosition.Y;
     this.Location = newPosition;
  }
}


这篇关于C#窗口效果.................................的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆