仿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());
}
}
}
仿XP系统的任务栏菜单的更多相关文章
- Winform中实现仿XP系统的任务栏菜单效果(附代码下载)
场景 效果 注: 博客主页: https://blog.csdn.net/badao_liumang_qizhi 关注公众号 霸道的程序猿 获取编程相关电子书.教程推送与免费下载. 实现 新建一个Fo ...
- 仿苹果电脑任务栏菜单&&拼图小游戏&&模拟表单控件
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- 手摸手,带你用vue实现后台管理权限系统及顶栏三级菜单显示
手摸手,带你用vue实现后台管理权限系统及顶栏三级菜单显示 效果演示地址 项目demo展示 重要功能总结 权限功能的实现 权限路由思路: 根据用户登录的roles信息与路由中配置的roles信息进行比 ...
- xp系统下硬盘安装centos6.5
引言: 电脑系统是Windows XP,电脑没有光驱.手头没有U盘.没有移动硬盘.电脑主板不支持U盘启动,在这种情况下想安装CentOS 6.0,有木有办法? 答案:有办法,请看下面教程! 必备工具: ...
- 怎么解决xp系统不能安装NET Framework4.0?
第一步: 如果是XP系统: 1.开始——运行——输入cmd——回车——在打开的窗口中输入net stop WuAuServ 2.开始——运行——输入%windir% 3.在打开的窗口中有个文件夹叫So ...
- 记一些之前忘记积累的问题(fiddler 学习、XP系统不能上网、XP不能装fiddler、注册表快速找到)
记一些之前忘记积累的问题: fiddler学习:http://www.cnblogs.com/kingwolf_JavaScript/archive/2012/11/07/FiddlerUI.html ...
- 用Jquery 仿VS 样式的 导航栏插件
在开发B/S 项目过程中,根据主界面设计要求,需要做一个类似VS 左边工具栏样式的菜单导航栏,在网上搜索无果后,于是决定自已做一个. 由于前台用JQuery开发, 想到网上很多人用JQuery做插件, ...
- 引用 xp系统引导修复(转载)
引用 3592wangxiaoxi 的 xp系统引导修复(转载) 原文来自百度知道a12424106关于“急需xp系统引导方面的知识!”的回复. XP系统的引导过程 如果想学习排除计算机系统故障,首先 ...
- “canvas画布仿window系统自带画图软件"项目的思考
"canvas画布仿window系统自带画图软件"项目的思考 首先贴上DEMO图,并没有美化效果.对UI有要求的,请自带补脑技术. 思考一 在做项目的过程中,我发现"工具 ...
随机推荐
- What's the Python Launcher?
Look! Python launcher 你可能在他处见到过这鬼东西,when you install or uninstall python, and so on.那么你肯定与我一样对这个鬼东西起 ...
- Html h1-h6 标签
Html h1-h6 标签 <html> <body> <!-- h1-h6标签:标题标签 --> <h1>XSK</h1> <h2& ...
- Python paramiko 修改源码实现用户命令抓取
paramiko 源码修改 paramiko主要用来实现ssh客户端.服务端链接,上一节我们说到了堡垒机,堡垒机内有一个需求是“用户行为审计”,在这里我们就可以通过修改paramiko内文件的源码来实 ...
- Link-Cut-Tree详解
图片参考YangZhe的论文,FlashHu大佬的博客 Link-Cut-Tree实际靠的是实链剖分,重链剖分和长链剖分珂以参考树链剖分详解 Link-Cut-Tree将某一个儿子的连边划分为实边,而 ...
- 处理table 超出部分滚动问题
我们有个需求是这样的,鉴于我的表达能力还是直接上原型图吧 今天主要记录上面的第四条解决过程. 首先我们的布局使用的table,当想给tbody设置高度的时候,发现不起作用.原因是table的默认是di ...
- selenium+java利用AutoIT实现文件上传
转自https://www.cnblogs.com/yunman/p/7112882.html?utm_source=itdadao&utm_medium=referral 1.AutoIT介 ...
- [CodeForces 1141A] Game 23
题目链接:http://codeforces.com/problemset/problem/1141/A 首先,nn一定要是mm的倍数.否则就无法转换,输出-1: 然后令k=.\frac{m}{n} ...
- POJ1141 Brackets Sequence---区间DP+输出路径
题目意思就是输入一串括号,让你找到最小的补偿数目使括号串合法,并且输出补全后的串. 基本是区间DP的模板题,该题特别让你输出补全后的答案.这和区间dp的反向思路很像,就是把一个大的区间划分为多个互不干 ...
- 3、zabbix配置入门
Zabbix模板 zabbix组件: zabbix-server zabbix-database zabbix-web zabbix-agent zabbix-proxy ...
- 数组toString()方法,数组常用操作
int[] arr ={1,2,3,4,5}; String arrString = Arrays.toString(arr); //输出[I@7150bd4d System.out.println( ...