当前位置: 首页 > 新闻中心 > c#餐饮预订/酒店房间预订

c#餐饮预订/酒店房间预订

发布时间:2024-03-27 15:54:53

  1. 在c#winform中如何做出导航菜单,其效果如下图:
  2. C# 右击显示菜单栏
  3. C# winfrom 卷帘式菜单

一、在c#winform中如何做出导航菜单,其效果如下图:

自己用图片加一些位置计算的算法,处理一些事件,还是可以做出来的

二、C# 右击显示菜单栏

楼主 我遇到过这样的问题。。。

如果单纯的是为一个button添加快捷菜单的话,那么只用把button的contextmenustrip属性设置为contextmenustrip1就可以了,,但是不知道什么原因,notifyicon却不可以。你必须手动的为notifyicon添加click响应事件,在该响应事件中 ,判断当前鼠标是右击还是左击;;

private void notifyiconweatherreport_click(object sender, eventargs e)//单击任务栏图标激活窗体

{

mouseeventargs me = (mouseeventargs)e;

if (me.button == mousebuttons.left)

{

if (this.windowstate == formwindowstate.minimized)

{

this.windowstate = formwindowstate.normal;

}

this.activate();

this.notifyiconweatherreport.visible = false;

this.showintaskbar = true;

}

else if (me.button == mousebuttons.right)

{

point point = new point(cursor.position.x, cursor.position.y);

this.contextmenustrippop.show(point,toolstripdropdowndirection.aboveleft);

}

}

三、C# winfrom 卷帘式菜单

自己写一个就是了吧:最外层就是一个panel,然后一个按钮+一个panel往里面填充,主构造就出来了;再在子级的panel上面填充子级的按钮,最后用图片或是gdi什么的美化一下,给按钮添加事件(主按钮的事件就是显示隐藏其对应的panel,子按钮对应相应的功能),搞定,收工