仿XP系统的任务栏菜单
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace 仿XP系统的任务栏菜单
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private static Panel Var_Panel = new Panel();
private static PictureBox Var_Pict = new PictureBox();
private static int Var_i = 0;
private Font Var_Font = new Font("宋体", 9);
private void pictureBox_1_Click(object sender, EventArgs e)
{
Var_i = Convert.ToInt16(((PictureBox)sender).Tag.ToString());
switch (Var_i)
{
case 1:
{
Var_Panel = panel_Gut_1;
Var_Pict = pictureBox_1;
break;
}
case 2:
{
Var_Panel = panel_Gut_2;
Var_Pict = pictureBox_2;
break;
}
case 3:
{
Var_Panel = panel_Gut_3;
Var_Pict = pictureBox_3;
break;
}
}
if (Convert.ToInt16(Var_Panel.Tag.ToString()) == 0 || Convert.ToInt16(Var_Panel.Tag.ToString()) == 2)
{
Var_Panel.Tag = 1;//隐藏标识
Var_Pict.Image = null;
Var_Pict.Image = Properties.Resources.朝下按钮;
Var_Panel.Visible = false;
}
else
{
if (Convert.ToInt16(Var_Panel.Tag.ToString()) == 1)
{
Var_Panel.Tag = 2;//显示标识
Var_Pict.Image = null;
Var_Pict.Image = Properties.Resources.朝上按钮;
Var_Panel.Visible = true;
}
}
}
private void Form1_Load(object sender, EventArgs e)
{
pictureBox_1.Image = null;
pictureBox_1.Image = Properties.Resources.朝上按钮;
pictureBox_2.Image = null;
pictureBox_2.Image = Properties.Resources.朝上按钮;
pictureBox_3.Image = null;
pictureBox_3.Image = Properties.Resources.朝上按钮;
Var_Font = label_1.Font;
}
private void label_1_MouseEnter(object sender, EventArgs e)
{
((Label)sender).ForeColor = Color.Gray;
((Label)sender).Font = new Font(Var_Font, Var_Font.Style | FontStyle.Underline);
}
private void label_1_MouseLeave(object sender, EventArgs e)
{
((Label)sender).ForeColor = Color.Black;
((Label)sender).Font = new Font(Var_Font, Var_Font.Style);
}
}
}
namespace 仿XP系统的任务栏菜单
{
partial class Form1
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
this.panel1 = new System.Windows.Forms.Panel();
this.panel_All = new System.Windows.Forms.Panel();
this.panel_Gut_3 = new System.Windows.Forms.Panel();
this.label_7 = new System.Windows.Forms.Label();
this.label_6 = new System.Windows.Forms.Label();
this.panel_Title3 = new System.Windows.Forms.Panel();
this.pictureBox_3 = new System.Windows.Forms.PictureBox();
this.panel_Border_2 = new System.Windows.Forms.Panel();
this.panel_Gut_2 = new System.Windows.Forms.Panel();
this.label_5 = new System.Windows.Forms.Label();
this.label_4 = new System.Windows.Forms.Label();
this.label_3 = new System.Windows.Forms.Label();
this.panel_Title_2 = new System.Windows.Forms.Panel();
this.pictureBox_2 = new System.Windows.Forms.PictureBox();
this.panel_Border_1 = new System.Windows.Forms.Panel();
this.panel_Gut_1 = new System.Windows.Forms.Panel();
this.label_2 = new System.Windows.Forms.Label();
this.label_1 = new System.Windows.Forms.Label();
this.panel_Title_1 = new System.Windows.Forms.Panel();
this.pictureBox_1 = new System.Windows.Forms.PictureBox();
this.panel_All.SuspendLayout();
this.panel_Gut_3.SuspendLayout();
this.panel_Title3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox_3)).BeginInit();
this.panel_Gut_2.SuspendLayout();
this.panel_Title_2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox_2)).BeginInit();
this.panel_Gut_1.SuspendLayout();
this.panel_Title_1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox_1)).BeginInit();
this.SuspendLayout();
//
// panel1
//
this.panel1.BackgroundImage = global::仿XP系统的任务栏菜单.Properties.Resources._1;
this.panel1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(208, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(352, 347);
this.panel1.TabIndex = 1;
//
// panel_All
//
this.panel_All.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panel_All.BackgroundImage")));
this.panel_All.Controls.Add(this.panel_Gut_3);
this.panel_All.Controls.Add(this.panel_Title3);
this.panel_All.Controls.Add(this.panel_Border_2);
this.panel_All.Controls.Add(this.panel_Gut_2);
this.panel_All.Controls.Add(this.panel_Title_2);
this.panel_All.Controls.Add(this.panel_Border_1);
this.panel_All.Controls.Add(this.panel_Gut_1);
this.panel_All.Controls.Add(this.panel_Title_1);
this.panel_All.Dock = System.Windows.Forms.DockStyle.Left;
this.panel_All.Location = new System.Drawing.Point(0, 0);
this.panel_All.Name = "panel_All";
this.panel_All.Size = new System.Drawing.Size(208, 347);
this.panel_All.TabIndex = 0;
//
// panel_Gut_3
//
this.panel_Gut_3.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panel_Gut_3.BackgroundImage")));
this.panel_Gut_3.Controls.Add(this.label_7);
this.panel_Gut_3.Controls.Add(this.label_6);
this.panel_Gut_3.Dock = System.Windows.Forms.DockStyle.Top;
this.panel_Gut_3.Location = new System.Drawing.Point(0, 262);
this.panel_Gut_3.Name = "panel_Gut_3";
this.panel_Gut_3.Size = new System.Drawing.Size(208, 81);
this.panel_Gut_3.TabIndex = 7;
this.panel_Gut_3.Tag = "0";
//
// label_7
//
this.label_7.AutoSize = true;
this.label_7.BackColor = System.Drawing.Color.Transparent;
this.label_7.Location = new System.Drawing.Point(43, 48);
this.label_7.Name = "label_7";
this.label_7.Size = new System.Drawing.Size(53, 12);
this.label_7.TabIndex = 1;
this.label_7.Text = "我的文档";
this.label_7.MouseLeave += new System.EventHandler(this.label_1_MouseLeave);
this.label_7.MouseEnter += new System.EventHandler(this.label_1_MouseEnter);
//
// label_6
//
this.label_6.AutoSize = true;
this.label_6.BackColor = System.Drawing.Color.Transparent;
this.label_6.Location = new System.Drawing.Point(43, 20);
this.label_6.Name = "label_6";
this.label_6.Size = new System.Drawing.Size(53, 12);
this.label_6.TabIndex = 0;
this.label_6.Text = "我的电脑";
this.label_6.MouseLeave += new System.EventHandler(this.label_1_MouseLeave);
this.label_6.MouseEnter += new System.EventHandler(this.label_1_MouseEnter);
//
// panel_Title3
//
this.panel_Title3.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panel_Title3.BackgroundImage")));
this.panel_Title3.Controls.Add(this.pictureBox_3);
this.panel_Title3.Dock = System.Windows.Forms.DockStyle.Top;
this.panel_Title3.Location = new System.Drawing.Point(0, 237);
this.panel_Title3.Name = "panel_Title3";
this.panel_Title3.Size = new System.Drawing.Size(208, 25);
this.panel_Title3.TabIndex = 6;
//
// pictureBox_3
//
this.pictureBox_3.Cursor = System.Windows.Forms.Cursors.Hand;
this.pictureBox_3.Location = new System.Drawing.Point(171, 3);
this.pictureBox_3.Name = "pictureBox_3";
this.pictureBox_3.Size = new System.Drawing.Size(20, 20);
this.pictureBox_3.TabIndex = 0;
this.pictureBox_3.TabStop = false;
this.pictureBox_3.Tag = "3";
this.pictureBox_3.Click += new System.EventHandler(this.pictureBox_1_Click);
//
// panel_Border_2
//
this.panel_Border_2.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panel_Border_2.BackgroundImage")));
this.panel_Border_2.Dock = System.Windows.Forms.DockStyle.Top;
this.panel_Border_2.Location = new System.Drawing.Point(0, 227);
this.panel_Border_2.Name = "panel_Border_2";
this.panel_Border_2.Size = new System.Drawing.Size(208, 10);
this.panel_Border_2.TabIndex = 5;
//
// panel_Gut_2
//
this.panel_Gut_2.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panel_Gut_2.BackgroundImage")));
this.panel_Gut_2.Controls.Add(this.label_5);
this.panel_Gut_2.Controls.Add(this.label_4);
this.panel_Gut_2.Controls.Add(this.label_3);
this.panel_Gut_2.Dock = System.Windows.Forms.DockStyle.Top;
this.panel_Gut_2.Location = new System.Drawing.Point(0, 146);
this.panel_Gut_2.Name = "panel_Gut_2";
this.panel_Gut_2.Size = new System.Drawing.Size(208, 81);
this.panel_Gut_2.TabIndex = 4;
this.panel_Gut_2.Tag = "0";
//
// label_5
//
this.label_5.AutoSize = true;
this.label_5.BackColor = System.Drawing.Color.Transparent;
this.label_5.Location = new System.Drawing.Point(43, 59);
this.label_5.Name = "label_5";
this.label_5.Size = new System.Drawing.Size(53, 12);
this.label_5.TabIndex = 2;
this.label_5.Text = "Internet";
this.label_5.MouseLeave += new System.EventHandler(this.label_1_MouseLeave);
this.label_5.MouseEnter += new System.EventHandler(this.label_1_MouseEnter);
//
// label_4
//
this.label_4.AutoSize = true;
this.label_4.BackColor = System.Drawing.Color.Transparent;
this.label_4.Location = new System.Drawing.Point(43, 37);
this.label_4.Name = "label_4";
this.label_4.Size = new System.Drawing.Size(41, 12);
this.label_4.TabIndex = 1;
this.label_4.Text = "计算器";
this.label_4.MouseLeave += new System.EventHandler(this.label_1_MouseLeave);
this.label_4.MouseEnter += new System.EventHandler(this.label_1_MouseEnter);
//
// label_3
//
this.label_3.AutoSize = true;
this.label_3.BackColor = System.Drawing.Color.Transparent;
this.label_3.Location = new System.Drawing.Point(43, 15);
this.label_3.Name = "label_3";
this.label_3.Size = new System.Drawing.Size(41, 12);
this.label_3.TabIndex = 0;
this.label_3.Text = "记事本";
this.label_3.MouseLeave += new System.EventHandler(this.label_1_MouseLeave);
this.label_3.MouseEnter += new System.EventHandler(this.label_1_MouseEnter);
//
// panel_Title_2
//
this.panel_Title_2.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panel_Title_2.BackgroundImage")));
this.panel_Title_2.Controls.Add(this.pictureBox_2);
this.panel_Title_2.Dock = System.Windows.Forms.DockStyle.Top;
this.panel_Title_2.Location = new System.Drawing.Point(0, 121);
this.panel_Title_2.Name = "panel_Title_2";
this.panel_Title_2.Size = new System.Drawing.Size(208, 25);
this.panel_Title_2.TabIndex = 3;
//
// pictureBox_2
//
this.pictureBox_2.Cursor = System.Windows.Forms.Cursors.Hand;
this.pictureBox_2.Location = new System.Drawing.Point(171, 3);
this.pictureBox_2.Name = "pictureBox_2";
this.pictureBox_2.Size = new System.Drawing.Size(20, 20);
this.pictureBox_2.TabIndex = 0;
this.pictureBox_2.TabStop = false;
this.pictureBox_2.Tag = "2";
this.pictureBox_2.Click += new System.EventHandler(this.pictureBox_1_Click);
//
// panel_Border_1
//
this.panel_Border_1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panel_Border_1.BackgroundImage")));
this.panel_Border_1.Dock = System.Windows.Forms.DockStyle.Top;
this.panel_Border_1.Location = new System.Drawing.Point(0, 111);
this.panel_Border_1.Name = "panel_Border_1";
this.panel_Border_1.Size = new System.Drawing.Size(208, 10);
this.panel_Border_1.TabIndex = 2;
//
// panel_Gut_1
//
this.panel_Gut_1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panel_Gut_1.BackgroundImage")));
this.panel_Gut_1.Controls.Add(this.label_2);
this.panel_Gut_1.Controls.Add(this.label_1);
this.panel_Gut_1.Dock = System.Windows.Forms.DockStyle.Top;
this.panel_Gut_1.Location = new System.Drawing.Point(0, 30);
this.panel_Gut_1.Name = "panel_Gut_1";
this.panel_Gut_1.Size = new System.Drawing.Size(208, 81);
this.panel_Gut_1.TabIndex = 1;
this.panel_Gut_1.Tag = "0";
//
// label_2
//
this.label_2.AutoSize = true;
this.label_2.BackColor = System.Drawing.Color.Transparent;
this.label_2.Location = new System.Drawing.Point(43, 48);
this.label_2.Name = "label_2";
this.label_2.Size = new System.Drawing.Size(77, 12);
this.label_2.TabIndex = 1;
this.label_2.Text = "客户信息录入";
this.label_2.MouseLeave += new System.EventHandler(this.label_1_MouseLeave);
this.label_2.MouseEnter += new System.EventHandler(this.label_1_MouseEnter);
//
// label_1
//
this.label_1.AutoSize = true;
this.label_1.BackColor = System.Drawing.Color.Transparent;
this.label_1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label_1.Location = new System.Drawing.Point(43, 20);
this.label_1.Name = "label_1";
this.label_1.Size = new System.Drawing.Size(77, 12);
this.label_1.TabIndex = 0;
this.label_1.Text = "产品信息录入";
this.label_1.MouseLeave += new System.EventHandler(this.label_1_MouseLeave);
this.label_1.MouseEnter += new System.EventHandler(this.label_1_MouseEnter);
//
// panel_Title_1
//
this.panel_Title_1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panel_Title_1.BackgroundImage")));
this.panel_Title_1.Controls.Add(this.pictureBox_1);
this.panel_Title_1.Dock = System.Windows.Forms.DockStyle.Top;
this.panel_Title_1.Location = new System.Drawing.Point(0, 0);
this.panel_Title_1.Name = "panel_Title_1";
this.panel_Title_1.Size = new System.Drawing.Size(208, 30);
this.panel_Title_1.TabIndex = 0;
//
// pictureBox_1
//
this.pictureBox_1.Cursor = System.Windows.Forms.Cursors.Hand;
this.pictureBox_1.Location = new System.Drawing.Point(171, 8);
this.pictureBox_1.Name = "pictureBox_1";
this.pictureBox_1.Size = new System.Drawing.Size(20, 20);
this.pictureBox_1.TabIndex = 0;
this.pictureBox_1.TabStop = false;
this.pictureBox_1.Tag = "1";
this.pictureBox_1.Click += new System.EventHandler(this.pictureBox_1_Click);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(560, 347);
this.Controls.Add(this.panel1);
this.Controls.Add(this.panel_All);
this.Name = "Form1";
this.Text = "仿XP系统的任务栏菜单";
this.Load += new System.EventHandler(this.Form1_Load);
this.panel_All.ResumeLayout(false);
this.panel_Gut_3.ResumeLayout(false);
this.panel_Gut_3.PerformLayout();
this.panel_Title3.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pictureBox_3)).EndInit();
this.panel_Gut_2.ResumeLayout(false);
this.panel_Gut_2.PerformLayout();
this.panel_Title_2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pictureBox_2)).EndInit();
this.panel_Gut_1.ResumeLayout(false);
this.panel_Gut_1.PerformLayout();
this.panel_Title_1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pictureBox_1)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel panel_All;
private System.Windows.Forms.Panel panel_Title_1;
private System.Windows.Forms.Panel panel_Gut_2;
private System.Windows.Forms.Panel panel_Title_2;
private System.Windows.Forms.Panel panel_Border_1;
private System.Windows.Forms.Panel panel_Gut_1;
private System.Windows.Forms.Panel panel_Border_2;
private System.Windows.Forms.Panel panel_Title3;
private System.Windows.Forms.Panel panel_Gut_3;
private System.Windows.Forms.PictureBox pictureBox_1;
private System.Windows.Forms.PictureBox pictureBox_2;
private System.Windows.Forms.PictureBox pictureBox_3;
private System.Windows.Forms.Label label_2;
private System.Windows.Forms.Label label_1;
private System.Windows.Forms.Label label_5;
private System.Windows.Forms.Label label_4;
private System.Windows.Forms.Label label_3;
private System.Windows.Forms.Label label_7;
private System.Windows.Forms.Label label_6;
private System.Windows.Forms.Panel panel1;
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
namespace 仿XP系统的任务栏菜单
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}
转载于:https://www.cnblogs.com/cddaishi/p/7423152.html
仿XP系统的任务栏菜单相关推荐
- Winform中实现仿XP系统的任务栏菜单效果(附代码下载)
场景 效果 注: 博客主页: https://blog.csdn.net/badao_liumang_qizhi 关注公众号 霸道的程序猿 获取编程相关电子书.教程推送与免费下载. 实现 新建一个Fo ...
- 雨林木风 发布高仿XP系统
雨林木风在2009/12/24平安夜发布高仿XP,系统.目前:www.ylmf.org已提供下载,有兴趣的朋友可以下载试试看看,待本人测试完成后再上传图片,希望不要让人失望. Ylmf OS 详细特性 ...
- 雨林木风高仿XP系统 3.0版下载地址
今天,Ylmf OS 3.0,或许你会眼前一亮,你会觉得它相比老版顺手很多,它是用不同的创意来诠释应用上的便利.我们对提高用户体验充满信心. 雨林木风开源操作系统一直受到全球关注,有更多的资 ...
- android安卓仿 win桌面 开源,安卓的XP系统 XP Mod Launcher小体验
Android手机最吸引人的地方就是它的开源性,可以随意享受其他第三方应用所带来的乐趣.在Android手机上尝试Windows系统是一些手机发烧友们的探索项目,无论是远程控制还是虚拟机,都已经有人实 ...
- android 苹果电脑底部图标滚动效果,JS实现仿苹果底部任务栏菜单效果代码
本文实例讲述了JS实现仿苹果底部任务栏菜单效果代码.分享给大家供大家参考.具体如下: 这款仿苹果电脑的底部任务栏菜单,是纯JavaScript实现的菜单特效,鼠标放上有响应效果,菜单图标会变大,而且动 ...
- xp系统计算机语言设置,XP系统语言栏不见了解决方法
XP系统语言栏不见了解决方法 随着移动计算技术的发展,笔记本电脑应用日趋广泛,市场规模也不断扩大,但是笔记本电脑用久了也会给我们带来些问题,比如语言栏不见了,遇到这种情况我们具体该怎么解决呢?下面就由 ...
- xp系统语言栏消失中英文切换
最常见是只能使用一种默认的输入法,不能切换其它的输入法,或者是上网聊天时只能输入英文字母.再看任务栏中那个语言栏没有了.好了,看看下面让它重现吧! 1右击任务栏空白处,再点工具栏,看看语言栏前面有对勾 ...
- 计算机xp系统是什么意思,WindowsXP启动的高级选项菜单分别代表什么意思
WindowsXP启动的高级选项菜单分别代表什么意思 发布时间:2014-07-16 17:11:59 作者:佚名 我要评论 进入WindowsXP启动的高级选项菜单,在这里可以选择除正常启动 ...
- xp系统 任务栏 “搜索桌面” 如何去掉
针对XP系统,有时候在某些系统更新后, 任务栏右下角出现 搜索桌面的InputBox, 去掉方式: 右击任务栏 -- 工具栏 -- Windows Search 桌面工具栏 (勾掉).
- android美团底部栏实现,仿美团APP的底部滑动菜单实现
背景:在现在的APP的应用中,类似仿美团APP的底部滑动菜单,应用是挺多的,例如QQ,微信,支付宝都应用到. 开发流程 1)设置selector(背景选择器),在res的目录下建立新的文件夹(draw ...
最新文章
- Asp.net 2.0 制作复合控件示例(二)[示例代码下载]
- linux top交叉编译_ARM Linux交叉编译工具链的制作
- LiveVideoStack线上分享第三季(十四):FLV封装格式介绍及解析
- SetTimer和KillTimer详解
- java推送Comet_使用Comet4j实现消息推送
- [2014]Hiring Report of IT Company
- byteofpython.info_A Byte of Python 笔记(7)数据结构:列表、元组、字典,序列
- 贺利坚老师汇编课程27笔记(二):loop和[bx]访问连续内存单元
- SAP 软件PS 模块系统操作之一工作分解结构(WBS)的创建
- 微软Win8Server2012各版本安装密匙序列号
- 我的世界空岛服务器修改地形,我的世界空岛制作教程 特别地形制作
- 红孩儿编辑器的模块设计10
- html文本间距1.5倍怎么设置,行距怎么设置18磅
- 华为云服务之存储服务
- java横向导出excel_JavaWeb POI 导出Excel
- ResNext架构解析:深度神经网络的聚合残差变换
- python求三位数的最大公约数和最小公倍数(3种算法)
- js的Canvas逆时针旋转90度
- 4个图片无损压缩工具,快速批量压缩图片,图片高清不糊
- 郭敬明:7亿级产品经理的五大绝招
热门文章
- 支持Delphi2009/2010的DES加密单元
- FLASH+XML:构建简单易更新网站
- “鬼才”论文致谢刷屏!感谢我导“似导非导”的指导……
- 学术 | 如何写一篇学术论文?(下)
- NLP高阶实战必读:一文走遍完整自然语言处理流程 文章
- 【NLP】doc2vec原理及实践
- python 日历+记事
- 【每日算法Day 108】一道简单的二叉树题目,写法还是挺多的。
- 【每日算法Day 63】LeetCode 第 179 场周赛题解
- 数据结构与算法python—9.二叉树及python实现