c#制作悬浮窗 高手来助我!!! 用c#如何制作像flashget样的悬浮窗啊?请高手把代码贴下 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 设置TopMost为true即可。BorderStyle设为None。然后处理MouseDownMouseMoveMouseUp这三个事件可以加在ContextMenu。 请问愚翁:能不能贴出代码昨天我就是这么写的,但总觉有问题 比如:怎么实现拖动BorderStyle设为None的formmousedown事件中如何弹出原来的主窗口刚刚开始c#编写,不是太熟望愚翁指教 看了你的blog不错 稍后我会整理到blog中private Point ptMouseCurrrnetPos,ptMouseNewPos,ptFormPos,ptFormNewPos;private bool blnMouseDown=false;private void frmTopMost_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e){ if( blnMouseDown ) { //get the position of the mouse in the screen ptMouseNewPos = Control.MousePosition; ptFormNewPos.X = ptMouseNewPos.X - ptMouseCurrrnetPos.X + ptFormPos.X; ptFormNewPos.Y = ptMouseNewPos.Y - ptMouseCurrrnetPos.Y + ptFormPos.Y; Location = ptFormNewPos; ptFormPos = ptFormNewPos; ptMouseCurrrnetPos = ptMouseNewPos; } }private void frmTopMost_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e){ if(e.Button==MouseButtons.Left) { blnMouseDown = true; ptMouseCurrrnetPos = Control.MousePosition; ptFormPos = Location; }}private void frmTopMost_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e){ if( e.Button == MouseButtons.Left) blnMouseDown = false;} 这是谢谢愚翁!留个mail或者联系方式吧 有问题多向你请教我等会试试 然后给分谢谢 还有个问题:双击悬浮窗如何打开原来的窗体呢?要用到MDI窗体吗? 自己搞定了!错误理解了MDI窗体 private void Form2_DoubleClick(object sender, System.EventArgs e) { //this.Hide(); this.Owner.Show(); this.Close(); } }创建窗体的地方:Form2 form = new Form2();form.Owner = this;form.Show(); 水晶报表打印范围的问题 用C#怎么实现打印功能??像Word那样, 如何用c#获得这个网站的源码? 怪异的算法,请高人指点! 急!:拟用C#开发测控设备上位机,求C#串行口通讯方法和通讯数据传输方法 如何在自定义控件的属性里选择值 有谁知道Access的? WPF,请问关于动态资源 打包问题:哪里能找到MDAC2.7 我做安装程序要用 在C#中我用API创建快捷方式,如下写出的 VS2005的dataGridView自定义列问题 关于线程的一个问题。如何在一个窗体内启动一个线程 作为前台显示等待,后台对数据库进行操作。 谢谢!!!
BorderStyle设为None。
然后处理
MouseDown
MouseMove
MouseUp
这三个事件可以加在ContextMenu。
昨天我就是这么写的,但总觉有问题
比如:怎么实现拖动BorderStyle设为None的form
mousedown事件中如何弹出原来的主窗口
刚刚开始c#编写,不是太熟
望愚翁指教 看了你的blog不错
private Point ptMouseCurrrnetPos,ptMouseNewPos,ptFormPos,ptFormNewPos;
private bool blnMouseDown=false;private void frmTopMost_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{
if( blnMouseDown )
{
//get the position of the mouse in the screen
ptMouseNewPos = Control.MousePosition;
ptFormNewPos.X = ptMouseNewPos.X - ptMouseCurrrnetPos.X + ptFormPos.X;
ptFormNewPos.Y = ptMouseNewPos.Y - ptMouseCurrrnetPos.Y + ptFormPos.Y;
Location = ptFormNewPos;
ptFormPos = ptFormNewPos;
ptMouseCurrrnetPos = ptMouseNewPos;
}
}private void frmTopMost_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
if(e.Button==MouseButtons.Left)
{
blnMouseDown = true;
ptMouseCurrrnetPos = Control.MousePosition;
ptFormPos = Location;
}
}private void frmTopMost_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
{
if( e.Button == MouseButtons.Left)
blnMouseDown = false;
}
我等会试试 然后给分
谢谢
要用到MDI窗体吗?
private void Form2_DoubleClick(object sender, System.EventArgs e)
{ //this.Hide();
this.Owner.Show();
this.Close();
}
}
创建窗体的地方:
Form2 form = new Form2();
form.Owner = this;
form.Show();